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