Пример #1
0
 void AskForEventArgs(EventRegisterArgs args)
 {
     if (typeof(Player) == args.SenderType)
     {
         object oargs = createInstance(selectConstructer(args.ArgsType));
         args.Method.Method.Invoke(args.Method.Target, new object[] { this, oargs });
     }
 }
Пример #2
0
 void OnRegister(object sender, EventRegisterArgs args)
 {
     if (args.Registering)
     {
         IO.WriteLine(args.Method.Target.GetType().Name + " registered to receive " + args.ArgsType.Name + " from " + args.SenderType.Name);
         AskForEventArgs(args);
     }
     else
     {
         IO.WriteLine(args.Method.Target.GetType().Name + " aborted to receive " + args.ArgsType.Name + " from " + args.SenderType.Name);
     }
 }