Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            ConcreteDispatcherFactory factory = new ConcreteDispatcherFactory();

            var red  = new RedCell();
            var blue = new BlueCell();

            var disp = factory.CreateDispatcher();

            var result = red.AcceptVisitor(disp.Visit(blue));

            Console.WriteLine(result);

            Console.Write("Done");
            Console.Read();
        }
Ejemplo n.º 2
0
 public TResult Visit(RedCell cell)
 {
     return(_takeRed(_target, cell));
 }
Ejemplo n.º 3
0
 public ICellVisitor <TResult> Visit(RedCell cell)
 {
     return(_redBuilder.Take(cell));
 }
Ejemplo n.º 4
0
 public string Visit(RedCell cell)
 {
     return(cell.Color);
 }
Ejemplo n.º 5
0
 private string Do(RedCell a, RedCell b)
 {
     return("красное на красном");
 }