public void Visit(ConcreteElementB element) { Console.WriteLine("Visitor 2 is visiting {0}", element.GetType().Name); }
public override void VisitConcreteElementB(ConcreteElementB concreteElementB) { Console.WriteLine("{0}被{1}访问", concreteElementB.GetType().Name, this.GetType().Name); }
public abstract void Visit(ConcreteElementB element);
public override void Visit(ConcreteElementB element) { Console.WriteLine("VisitorB visited ElementB : {0}", element.Title); }
public abstract void VisitConcreteElementB( ConcreteElementB concreteElementB);
public override void VisitConcreteElementB(ConcreteElementB elementB) { elementB.OperationB(); }
public abstract void VisitConcreteElementB(ConcreteElementB concreteElementB);
public string Vist(ConcreteElementB element) { Console.WriteLine("Visiting With ElementB: " + element.ElementBProp); return(element.ElementBProp + " + The not so cool new data added by ConcreteVisitor."); }
public override void VisitConcreteElementB(ConcreteElementB concreteElementB) { Console.WriteLine($"{concreteElementB.GetType().Name}被{this.GetType().Name}存取"); }
public override void VisitConcreteElementB(ConcreteElementB concreteElementB) { Console.WriteLine($"{concreteElementB.GetType().Name} visited by {GetType().Name}"); }