Example #1
0
        static void Main(string[] args)
        {
            {
                ChatMediator chat  = new ChatMediator();
                IUser        user1 = new PremiumUser()
                {
                    Name = "FirstPerson"
                };
                IUser user2 = new BasicUser()
                {
                    Name = "SecondPerson"
                };
                IUser user3 = new BasicUser()
                {
                    Name = "ThirdsPerson"
                };

                chat.AddUser(user1);
                chat.AddUser(user2);
                chat.AddUser(user3);



                chat.SendMessage(user1, "Welcome");

                Console.ReadLine();
            }
        }
Example #2
0
        static void Main(string[] args)
        {
            ChatMediator chatMediator = new ChatMediator();
            IUser        u1           = new BasicUser();

            u1.Name = "Arthur";
            IUser u2 = new PremiumUser();

            u2.Name = "Bruce";
            IUser u3 = new BasicUser();

            u3.Name = "Clark";
            chatMediator.AddUser(u1);
            chatMediator.AddUser(u2);
            chatMediator.AddUser(u3);



            chatMediator.SendMessage(u1, "Hello");
            //Console.WriteLine("\n\n***********\n\n");
            //chatMediator.SendMessage(u2, "hii guys");


            Console.ReadLine();
        }
Example #3
0
        static void Main(string[] args)
        {
            ChatMediator chat  = new ChatMediator();
            IUser        user1 = new PremiumUser()
            {
                Name = "AJ"
            };
            IUser user2 = new BasicUser()
            {
                Name = "Asuma"
            };
            IUser user3 = new BasicUser()
            {
                Name = "Kurenai"
            };

            chat.AddUser(user1);
            chat.AddUser(user2);
            chat.AddUser(user3);



            chat.SendMessage(user1, "Haiiii");
            chat.SendMessage(user3, "Helllo");
            Console.ReadLine();

            Console.ReadLine();
        }
Example #4
0
        static void Main(string[] args)
        {
            IChatMediator chatMediator = new ChatMediator();

            IUser john = new BasicUser(chatMediator, "John");
            IUser tina = new PremiumUser(chatMediator, "Tina");
            IUser lara = new PremiumUser(chatMediator, "Lara");

            chatMediator.Register(john);
            chatMediator.Register(tina);
            chatMediator.Register(lara);

            tina.SendMessage("Hello Everyone!");
            Console.ReadLine();
        }
Example #5
0
        static void Main(string[] args)
        {
            ChatMediator ChatMed = new ChatMediator();
            IUser        Sam     = new BasicUser(ChatMed, "Sam");
            IUser        Ram     = new BasicUser(ChatMed, "Ram");
            IUser        Tam     = new BasicUser(ChatMed, "Tam");
            IUser        Pam     = new PremiumUser(ChatMed, "Pam");

            ChatMed.AddUser(Sam);
            ChatMed.AddUser(Ram);
            ChatMed.AddUser(Tam);
            ChatMed.AddUser(Pam);

            Console.WriteLine();

            Sam.SendMessage("Hello All !!!");
            Console.WriteLine();
            Console.Read();
        }
Example #6
0
        static void Main(string[] args)
        {
            ChatMediator chatMediator = new ChatMediator();
            IUser        u1           = new BasicUser();

            u1.Name = "Anirudh";
            IUser u2 = new PremiumUser();

            u2.Name = "Yuvan";
            IUser u3 = new BasicUser();

            u3.Name = "Rahman";
            chatMediator.AddUser(u1);
            chatMediator.AddUser(u2);
            chatMediator.AddUser(u3);



            chatMediator.SendMessage(u1, "Hello Everyone");

            Console.ReadLine();
        }