예제 #1
0
        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);
        }
예제 #2
0
 private Command(FieldInfo field, CommandAttribute attribute, Type owner)
 {
     this.field = field;
     Initialize(attribute, owner);
 }
예제 #3
0
 private Command(PropertyInfo property, CommandAttribute attribute, Type owner)
 {
     this.property = property;
     Initialize(attribute, owner);
 }
예제 #4
0
 private Command(MethodInfo method, CommandAttribute attribute, Type owner)
 {
     this.method = method;
     Initialize(attribute, owner);
 }