GetCustomAttributes() public method

public GetCustomAttributes ( Type attributeType, bool inherit ) : Object[]
attributeType Type
inherit bool
return Object[]
Esempio n. 1
0
		private void WriteCustomAttributes(XmlWriter writer, Module module) 
		{
			WriteCustomAttributes(writer, module.GetCustomAttributes(this.rep.DocumentInheritedAttributes), "module");
		}
Esempio n. 2
0
		public static Attribute GetCustomAttribute (Module element, Type attributeType, bool inherit)
		{
			// neither parameter is allowed to be null
			CheckParameters (element, attributeType);

			// Module inheritance hierarchies CAN NOT be searched for attributes, so the second
			// parameter of GetCustomAttributes () is IGNORED.
			object[] attributes = element.GetCustomAttributes (attributeType, inherit);

			return FindAttribute (attributes);
		}
Esempio n. 3
0
		public static Attribute[] GetCustomAttributes (Module element, Type attributeType, bool inherit)
		{
			// element parameter is not allowed to be null
			CheckParameters (element, attributeType);

			return (Attribute []) element.GetCustomAttributes (attributeType, inherit);
		}
Esempio n. 4
0
        public static Attribute[] GetCustomAttributes(Module element, bool inherit)
        {
            if (element == null)
                throw new ArgumentNullException(nameof(element));
            Contract.EndContractBlock();

            return (Attribute[])element.GetCustomAttributes(typeof(Attribute), inherit);
        }
Esempio n. 5
0
        public static Attribute[] GetCustomAttributes(Module element, Type attributeType, bool inherit)
        {
            if (element == null)
                throw new ArgumentNullException(nameof(element));

            if (attributeType == null)
                throw new ArgumentNullException(nameof(attributeType));

            if (!attributeType.IsSubclassOf(typeof(Attribute)) && attributeType != typeof(Attribute))
                throw new ArgumentException(Environment.GetResourceString("Argument_MustHaveAttributeBaseClass"));
            Contract.EndContractBlock();

            return (Attribute[])element.GetCustomAttributes(attributeType, inherit);
        }
Esempio n. 6
0
 public static bool HasCustomAttribute <T>(this Module element) where T : Attribute
 => element.GetCustomAttributes <T>().FirstOrDefault() != null;
 public static ILookup<string, string> GetElements(Module module)
 {
     return module.GetCustomAttributes(typeof(ElementalAttribute))
         .Cast<ElementalAttribute>()
         .MakeLookup();
 }
 public static Attribute[] GetCustomAttributes(Module element, bool inherit)
 {
     if (element == null)
     {
         throw new ArgumentNullException("element");
     }
     return (Attribute[]) element.GetCustomAttributes(typeof(Attribute), inherit);
 }
 public static Attribute[] GetCustomAttributes(Module element, Type attributeType, bool inherit)
 {
     if (element == null)
     {
         throw new ArgumentNullException("element");
     }
     if (attributeType == null)
     {
         throw new ArgumentNullException("attributeType");
     }
     if (!attributeType.IsSubclassOf(typeof(Attribute)) && (attributeType != typeof(Attribute)))
     {
         throw new ArgumentException(Environment.GetResourceString("Argument_MustHaveAttributeBaseClass"));
     }
     return (Attribute[]) element.GetCustomAttributes(attributeType, inherit);
 }
 internal static Object[] GetCustomAttributes(Module target, Type caType, bool inherit) {
   if (!target.Assembly.ReflectionOnly)
     return target.GetCustomAttributes(caType, inherit);
   return CustomAttribute.ExtractCustomAttribute(CustomAttributeData.GetCustomAttributes(target), caType);
 }
Esempio n. 11
0
 public static IList <CustomAttributeData> GetCustomAttributes(Module target)
 {
     return(GetData(target.GetCustomAttributes(true)));
 }
Esempio n. 12
0
 public override object[] GetCustomAttributesImpl(Module mod, Type attributeType, bool inherit)
 {
     System.Diagnostics.Debug.WriteLine("In GetCustomAttributesImpl 1");
     #if !DEBUG || true
     var name = mod.Name;
     if (mod.Name.Contains("IKVM.OpenJDK") || name.Contains("CodenameOne") || name.Contains("HelloWindows"))
     {
         return new JavaModuleAttribute[] { new JavaModuleAttribute() };
     }
     #endif
     var s = mod.GetCustomAttributes(attributeType).ToArray();
     return s;
 }
Esempio n. 13
0
 public static IEnumerable <T> GetCustomAttributes <T>(this Module element) where T : Attribute
 {
     return((IEnumerable <T>)element.GetCustomAttributes(typeof(T)));
 }
Esempio n. 14
0
		public static Attribute[] GetCustomAttributes (Module element, bool inherit)
		{
			// element parameter is not allowed to be null
			CheckParameters (element, typeof (Attribute));

			return (Attribute []) element.GetCustomAttributes (inherit);
		}