コード例 #1
0
        private static void Main(string[] args)
        {
            var mediator = new ChatMediator();

            var u1 = new BasicUser(mediator, "user1");
            var u2 = new BasicUser(mediator, "user2");
            var u3 = new PremiumUser(mediator, "user3");

            mediator.AddUser(u2);
            mediator.AddUser(u3);

            u1.SendMessage("Test Broadcast");
        }
コード例 #2
0
 public BasicUser(ChatMediator chatMediator, string name)
 {
     this.chatMediator = chatMediator;
     this.name         = name;
 }
コード例 #3
0
 public PremiumUser(ChatMediator chatMediator, string name)
 {
     this.chatMediator = chatMediator;
     this.name         = name;
 }