Created
May 5, 2013 19:00
-
-
Save azenla/5521791 to your computer and use it in GitHub Desktop.
SharpIRC
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Reflection; | |
using System.Collections.Generic; | |
namespace SharpIRC | |
{ | |
public class EventRegistry { | |
public static Dictionary<string, MethodInfo> commandMethods = new Dictionary<string, MethodInfo> (); | |
public static void registerCommandClass(String className) { | |
Type t = Type.GetType (className); | |
C MethodInfo[] methods = t.GetMethods(); | |
foreach (MethodInfo method in methods) { | |
ParameterInfo[] parames = method.GetParameters(); | |
if (parames.Length!=1) { | |
continue; | |
} else if (!(parames[1].GetType().Name.Equals("MessageEvent"))) { | |
continue; | |
} | |
commandMethods.Add(method.Name, method); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment