Ejemplo n.º 1
0
        public static void EX1()
        {
            Mediator.Exemplo1.Mediator mediator     = new Exemplo1.Mediator();
            ConcreteColleague          participant  = new ConcreteColleague(mediator);
            ConcreteColleague2         participant2 = new ConcreteColleague2(mediator);

            mediator.AddParticipant(participant);
            mediator.AddParticipant(participant2);

            participant.Send("Message");
            participant2.Send("Response of message");
            participant.Send("OK");
            participant2.Send("Bye");
        }
Ejemplo n.º 2
0
        public static void EX1()
        {
            Mediator.Exemplo1.Mediator mediator = new Exemplo1.Mediator();
            ConcreteColleague participant = new ConcreteColleague(mediator);
            ConcreteColleague2 participant2 = new ConcreteColleague2(mediator);

            mediator.AddParticipant(participant);
            mediator.AddParticipant(participant2);

            participant.Send("Message");
            participant2.Send("Response of message");
            participant.Send("OK");
            participant2.Send("Bye");
        }
 public AbstractColleague(Mediator mediator)
 {
     _mediator = mediator;
 }
 public ConcreteColleague(Mediator mediator)
     : base(mediator)
 {
 }