示例#1
0
        static void Main(string[] args)
        {
            var mobileOperator = new MobileOperator();

            var mobileAccount1 = new MobileAccount("Max", "Kh", new DateTime(1998, 6, 23), new MailAddress("*****@*****.**"));

            var mobileAccount2 = new MobileAccount("Alex", "Kh", new DateTime(1992, 11, 27), new MailAddress("*****@*****.**"));

            mobileOperator.AddNumber(mobileAccount1);
            mobileOperator.AddNumber(mobileAccount2);

            mobileAccount1.AddContact(mobileAccount2.Number, new SubName("Alex"));

            mobileAccount1.MakeCall(mobileAccount2.Number);
            mobileAccount1.MakeCall(mobileAccount2.Number);
            mobileAccount1.MakeCall(mobileAccount2.Number);

            mobileAccount2.SendMessage(mobileAccount1.Number, "Hello");

            Console.WriteLine("Most Frequently Receiving Numbers");
            mobileOperator.Log.MostFrequentlyReceivingNumbers(5);

            Console.WriteLine("Most Frequently Sendering Numbers");
            mobileOperator.Log.MostFrequentlySendingNumbers(5);
        }
示例#2
0
        static void Main(string[] args)
        {
            var mobileOperator = new MobileOperator();

            var mobileAccount1 = new MobileAccount(123, "Alex");
            var mobileAccount2 = new MobileAccount(456, "Max");

            mobileOperator.AddNumber(mobileAccount1);
            mobileOperator.AddNumber(mobileAccount2);
            mobileAccount1.AddContact(456, "Max");

            mobileAccount2.MakeCall(123);
            mobileAccount2.MakeCall(123);
            mobileAccount2.MakeCall(123);
            mobileAccount2.MakeCall(123);
            mobileAccount1.MakeCall(456);
            mobileAccount1.MakeCall(456);
            mobileAccount1.MakeCall(456);

            mobileAccount2.SendMessage(123, "Hello");


            Console.WriteLine("Most Frequently Receiving Numbers");
            mobileOperator.MostFrequentlyReceivingNumbers(5);

            Console.WriteLine("Most Frequently Sendering Numbers");
            mobileOperator.MostFrequentlySendingNumbers(5);
        }
示例#3
0
        static void Main(string[] args)
        {
            var mobileOperator = new MobileOperator();

            var mobileAccount1 = new MobileAccount("Max", "Kh", new DateTime(1998, 6, 23), "*****@*****.**");
            var mobileAccount2 = new MobileAccount("Alex", "Kh", new DateTime(1992, 11, 27), "*****@*****.**");

            mobileOperator.AddNumber(mobileAccount1);
            mobileOperator.AddNumber(mobileAccount2);

            Console.WriteLine(mobileAccount1.Number);
            Console.WriteLine(mobileAccount2.Number);

            mobileAccount1.MakeCall(mobileAccount2.Number);

            mobileAccount2.MakeCall(mobileAccount1.Number);

            mobileAccount1.SendMessage(mobileAccount2.Number, "Message text");

            mobileOperator.Log.MostFrequentlyReceivingNumbers(5);
        }