示例#1
0
        static void TestEvents()
        {
            CardReset cardReset = new CardReset();
            Listener1 ml1       = new Listener1(cardReset);
            Listener2 ml2       = new Listener2(cardReset);

            cardReset.Register_Manual_CardResetDelegate(ml1.CallWhenCardReset_ManualEvent);

            // register additional no-data event(2):
            cardReset.NoDateEventHandler += ml2.CallWhenCardReset_NoDataEvent;

            // register additional event handler with data:
            cardReset.CardResetEventHandler += ml1.CallWhenCardReset_CardResetEvent;

            cardReset.Reset();
        }
 public Listener2(CardReset cardReset)
 {
     cardReset.Register_Manual_CardResetDelegate(CallWhenCardReset_ManualEvent);
     cardReset.NoDateEventHandler += CallWhenCardReset_NoDataEvent;
     cardReset.CardResetEventHandler += CallWhenCardReset_CardResetEvent;
 }