/// <summary> /// Looks for a method with the RegisterErrorHandlerFunctionAttribute /// </summary> /// <param name="type">the type you want looking for the method</param> /// <param name="method">the method when its found</param> /// <param name="attribute">the attribute when its found</param> /// <returns>true when the method was found</returns> public static bool GetRegisterErrorAttribute(Type type, ref MethodInfo method, ref RegisterErrorHandlerAttribute attribute) { foreach (MethodInfo item in type.GetMethods(BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic)) { object[] array = item.GetCustomAttributes(typeof(RegisterErrorHandlerAttribute), false); if (array.Length == 1) { method = item; attribute = array[0] as RegisterErrorHandlerAttribute; return true; } } return false; }
/// <summary> /// Looks for a method with the RegisterErrorHandlerFunctionAttribute /// </summary> /// <param name="type">the type you want looking for the method</param> /// <param name="method">the method when its found</param> /// <param name="attribute">the attribute when its found</param> /// <returns>true when the method was found</returns> public static bool GetRegisterErrorAttribute(Type type, ref MethodInfo method, ref RegisterErrorHandlerAttribute attribute) { foreach (MethodInfo item in type.GetMethods(BindingFlags.Static | BindingFlags.Public)) { object[] array = item.GetCustomAttributes(typeof(RegisterErrorHandlerAttribute), false); if (array.Length == 1) { method = item; attribute = array[0] as RegisterErrorHandlerAttribute; return(true); } } return(false); }