Exemplo n.º 1
0
        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
        }
Exemplo n.º 2
0
        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();
        }
Exemplo n.º 3
0
 public DevTeamA(MediatorManager mediator) : base(mediator)
 {
 }
Exemplo n.º 4
0
 public ClientA(MediatorManager mediaor) : base(mediaor)
 {
 }
Exemplo n.º 5
0
 public DevTeamAbstract(MediatorManager mediator)
 {
     _mediator = mediator;
 }
Exemplo n.º 6
0
 public ClientAbstract(MediatorManager mediator)
 {
     _mediatorManager = mediator;
 }