Esempio n. 1
0
 // this method requests a reference of child2
 private Child2 GetChild2()
 {
     // check if the event is assigned.
     if(RequestChild == null)
         return null;
     RequestChildEventArgs args = new RequestChildEventArgs();
     RequestChild2(this, args);
     return args.Child;
 }
Esempio n. 2
0
 // this method requests a reference of child1
 private Child1 GetChild1()
 {
     // check if the event is assigned.
     if(RequestChild1 == null)
         return null;
     RequestChildEventArgs<Child1> args = new RequestChildEventArgs<Child1>();
     RequestChild1(this, args);
     return args.Child;
 }