static void Main(string[] args) { #region meidator //var room = new ChatRoom(); //var john = new Person("john"); //var jane = new Person("Jane"); //room.Join(john); //room.Join(jane); //john.Say("hi"); //jane.Say("oh, hey john"); //var simon = new Person("Simon"); //room.Join(simon); //simon.Say("hi everyone"); //jane.PrivateMessage("Simon", "glad you could join us!"); #endregion #region Client Example MediatorManager mediator = new MediatorManager(); DevTeamAbstract devTeam = new DevTeamA(mediator); devTeam._devTeamType = "Dev Team A"; mediator.devTeam = devTeam; ClientAbstract client = new ClientA(mediator); client._clientName = "ClientA"; mediator.client = client; client.SendQueryToMediator(); #endregion }
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(); }
public DevTeamA(MediatorManager mediator) : base(mediator) { }
public ClientA(MediatorManager mediaor) : base(mediaor) { }
public DevTeamAbstract(MediatorManager mediator) { _mediator = mediator; }
public ClientAbstract(MediatorManager mediator) { _mediatorManager = mediator; }