Advertisement
Guest User

Untitled

a guest
May 14th, 2013
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.54 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Reflection;
  6.  
  7. namespace MyProject
  8. {
  9.     class MyTrigger
  10.     {
  11.         object obj;
  12.         string method;
  13.  
  14.         public MyTrigger(object obj, string method)
  15.         {
  16.             this.obj = obj;
  17.             this.method = method;
  18.         }
  19.  
  20.         public void Activate()
  21.         {
  22.             MethodInfo methodInfo = this.obj.GetType().GetMethod(this.method);
  23.             methodInfo.Invoke(this.obj, null);
  24.         }
  25.  
  26.  
  27.     }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement