public override void Init() { ClassEnumerator enumerator = new ClassEnumerator(typeof(SkillFuncHandlerClassAttribute), null, typeof(SkillFuncDelegator).Assembly, true, false, false); ListView <System.Type> .Enumerator enumerator2 = enumerator.results.GetEnumerator(); while (enumerator2.MoveNext()) { MethodInfo[] methods = enumerator2.Current.GetMethods(); for (int i = 0; (methods != null) && (i < methods.Length); i++) { MethodInfo info = methods[i]; if (info.IsStatic) { object[] customAttributes = info.GetCustomAttributes(typeof(SkillFuncHandlerAttribute), true); for (int j = 0; j < customAttributes.Length; j++) { SkillFuncHandlerAttribute attribute = customAttributes[j] as SkillFuncHandlerAttribute; if (attribute != null) { this.RegisterHandler(attribute.ID, (DealSkillFunc)Delegate.CreateDelegate(typeof(DealSkillFunc), info)); if (attribute.AdditionalIdList != null) { int length = attribute.AdditionalIdList.Length; for (int k = 0; k < length; k++) { this.RegisterHandler(attribute.AdditionalIdList[k], (DealSkillFunc)Delegate.CreateDelegate(typeof(DealSkillFunc), info)); } } } } } } } }
public override void Init() { ClassEnumerator classEnumerator = new ClassEnumerator(typeof(SkillFuncHandlerClassAttribute), null, typeof(SkillFuncDelegator).get_Assembly(), true, false, false); ListView <Type> .Enumerator enumerator = classEnumerator.get_results().GetEnumerator(); while (enumerator.MoveNext()) { Type current = enumerator.get_Current(); MethodInfo[] methods = current.GetMethods(); int num = 0; while (methods != null && num < methods.Length) { MethodInfo methodInfo = methods[num]; if (methodInfo.get_IsStatic()) { object[] customAttributes = methodInfo.GetCustomAttributes(typeof(SkillFuncHandlerAttribute), true); for (int i = 0; i < customAttributes.Length; i++) { SkillFuncHandlerAttribute skillFuncHandlerAttribute = customAttributes[i] as SkillFuncHandlerAttribute; if (skillFuncHandlerAttribute != null) { this.RegisterHandler(skillFuncHandlerAttribute.get_ID(), (DealSkillFunc)Delegate.CreateDelegate(typeof(DealSkillFunc), methodInfo)); if (skillFuncHandlerAttribute.get_AdditionalIdList() != null) { int num2 = skillFuncHandlerAttribute.get_AdditionalIdList().Length; for (int j = 0; j < num2; j++) { this.RegisterHandler(skillFuncHandlerAttribute.get_AdditionalIdList()[j], (DealSkillFunc)Delegate.CreateDelegate(typeof(DealSkillFunc), methodInfo)); } } } } } num++; } } }