public static CommandAttribute GetCommand(this MemberInfo member) { try { CommandAttribute attribute = null; object[] attributes = member.GetCustomAttributes(typeof(CommandAttribute), false); for (int a = 0; a < attributes.Length; a++) { if (attributes[a].GetType() == typeof(CommandAttribute)) { attribute = attributes[a] as CommandAttribute; return(attribute); } } } catch { //this could happen due to a TypeLoadException in builds } return(null); }
private Command(FieldInfo field, CommandAttribute attribute, Type owner) { this.field = field; Initialize(attribute, owner); }
private Command(PropertyInfo property, CommandAttribute attribute, Type owner) { this.property = property; Initialize(attribute, owner); }
private Command(MethodInfo method, CommandAttribute attribute, Type owner) { this.method = method; Initialize(attribute, owner); }