Example #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();
        }
Example #2
0
 public TResult Visit(RedCell cell)
 {
     return(_takeRed(_target, cell));
 }
Example #3
0
 public ICellVisitor <TResult> Visit(RedCell cell)
 {
     return(_redBuilder.Take(cell));
 }
Example #4
0
 public string Visit(RedCell cell)
 {
     return(cell.Color);
 }
Example #5
0
 private string Do(RedCell a, RedCell b)
 {
     return("красное на красном");
 }