Skip to content

Instantly share code, notes, and snippets.

@azenla
Created May 5, 2013 19:00
Show Gist options
  • Save azenla/5521791 to your computer and use it in GitHub Desktop.
Save azenla/5521791 to your computer and use it in GitHub Desktop.
SharpIRC
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