public void deleteAttributeInfo(Type t, object obj) { foreach (MethodInfo mi in t.GetMethods()) { InstallFun myattribute = (InstallFun)Attribute.GetCustomAttribute(mi, typeof(InstallFun)); if (myattribute == null) { } else { xmhelper.DeleteListen(mi.Name); } } }
public void GetAttributeInfo(Type t, object obj) { foreach (MethodInfo mi in t.GetMethods()) { InstallFun myattribute = (InstallFun)Attribute.GetCustomAttribute(mi, typeof(InstallFun)); if (myattribute == null) { } else { Delegate del = Delegate.CreateDelegate(typeof(RequestData), obj, mi, true); xmhelper.AddListen(mi.Name, del as RequestData, myattribute.Type); } } }