Esempio n. 1
0
        static void Main(string[] args)
        {
            MobileOperator mobileOperator = new MobileOperator();

            MobileAccount mobileAccount1 = new MobileAccount(123);
            MobileAccount mobileAccount2 = new MobileAccount(456);

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

            mobileAccount1.MakeCall(456);
            mobileAccount2.SendMessage(456, "Hello");
        }
Esempio n. 2
0
 public void AddNumber(MobileAccount mobileAccount)
 {
     mobileAccounts.Add(mobileAccount);
     mobileAccount.CallEvent    += MobileAccount_CallEvent;
     mobileAccount.MessageEvent += MobileAccount_MessageEvent;
 }