static void Main(string[] args) { ManagerMediator mediator = new ManagerMediator(); Colleague customer = new CustomerColleague(mediator); Colleague programmer = new ProgrammerColleague(mediator); Colleague tester = new TesterColleague(mediator); mediator.Customer = customer; mediator.Programmer = programmer; mediator.Tester = tester; customer.Send("Есть заказ, надо сделать программу"); programmer.Send("Программа готова, надо протестировать"); tester.Send("Программа протестирована и готова к продаже"); }
private static void Main() { var mediator = new ManagerMediator(); var customer = new CustomerColleague(mediator); var programmer = new ProgrammerColleague(mediator); var tester = new TesterColleague(mediator); mediator.Customer = customer; mediator.Programmer = programmer; mediator.Tester = tester; customer.Send("One more task"); programmer.Send("Merge task"); tester.Send("Pipeline passed"); }
static void Main(string[] args) { ManagerMediator mediator = new ManagerMediator(); Colleague customer = new CustomerColleague(mediator); Colleague programmer = new ProgrammerColleague(mediator); Colleague tester = new TesterColleague(mediator); mediator.Customer = customer; mediator.Programmer = programmer; mediator.Tester = tester; customer.Send("Here is my order, it needs to make a program."); programmer.Send("Application is ready."); tester.Send("App was tested and production ready."); Console.Read(); }
private static void Main(string[] args) { Console.ForegroundColor = ConsoleColor.Green; Console.Title = "Mediator"; var mediator = new MediatorManager(); Colleague customer = new CustomerColleague(mediator); Colleague programmer = new ProgrammerColleague(mediator); Colleague tester = new TesterColleague(mediator); mediator.Customer = customer; mediator.Programmer = programmer; mediator.Tester = tester; customer.Send("Есть заказ, надо сделать программу"); programmer.Send("Программа готова, надо протестировать"); tester.Send("Программа протестирована и готова к продаже"); Console.ReadKey(); }
static void Main(string[] args) { // Клиентский код. Component1 component1 = new Component1(); Component2 component2 = new Component2(); new ConcreteMediator(component1, component2); Console.WriteLine("Client triggets operation A."); component1.DoA(); Console.WriteLine(); Console.WriteLine("Client triggers operation D."); component2.DoD(); //----------------------------------------------------------------- ManagerMediator mediator = new ManagerMediator(); Colleague customer = new CustomerColleague(mediator); Colleague programmer = new ProgrammerColleague(mediator); Colleague tester = new TesterColleague(mediator); mediator.Customer = customer; mediator.Programmer = programmer; mediator.Tester = tester; customer.Send("Есть заказ, надо сделать программу"); programmer.Send("Программа готова, надо протестировать"); tester.Send("Программа протестирована и готова к продаже"); Console.WriteLine("Press any key to continue...."); Console.ReadLine(); }