标签:io ar cti sp on c new app text
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
public class Context
{
public Context(int day)
{
Day = day;
}
public int Day { get; set; }
}
public abstract class Handle
{
public abstract void Pass(Context context);
}
public class A : Handle
{
public override void Pass(Context context)
{
}
}
public class B : Handle
{
public override void Pass(Context context)
{
}
}
public class C : Handle
{
public override void Pass(Context context)
{
}
}
class Program
{
static void Main(string[] args)
{
Handle obj1 = new A();
Handle obj2 = new B();
Handle obj3 = new C();
obj1.Pass(new Context(1));
obj2.Pass(new Context(2));
obj3.Pass(new Context(3));
}
}
}
标签:io ar cti sp on c new app text
原文地址:http://www.cnblogs.com/liushangkui/p/3953066.html