Exemple #1
0
        //3. Create method to raise the event
        public void CheckBalance(int x)
        {
            if (x > 250)
            {
                // Raise the event
                evt("Attention!  The current balances exceeds $250.....");

                // Microsoft preferred implementation
                EvtArgsClass eac = new EvtArgsClass("Balance exceeds $250");
                mEvt(this, eac);
            }
        }
Exemple #2
0
 //Microsoft Preferred
 public void HandleTheEvent(object sender, EvtArgsClass e)
 {
     Console.WriteLine(String.Format("Attention!  from {0}  : {1}..", sender, e.msg));
 }