IsCustomAttributeDefined() static private method

static private IsCustomAttributeDefined ( Module decoratedModule, int decoratedMetadataToken, RuntimeType attributeFilterType ) : bool
decoratedModule Module
decoratedMetadataToken int
attributeFilterType RuntimeType
return bool
 internal static bool IsDefined(RuntimeMethodInfo method, RuntimeType caType, bool inherit)
 {
     if (PseudoCustomAttribute.IsDefined(method, caType))
     {
         return(true);
     }
     if (CustomAttribute.IsCustomAttributeDefined(method.GetRuntimeModule(), method.MetadataToken, caType))
     {
         return(true);
     }
     if (!inherit)
     {
         return(false);
     }
     method = method.GetParentDefinition();
     while (method != null)
     {
         if (CustomAttribute.IsCustomAttributeDefined(method.GetRuntimeModule(), method.MetadataToken, caType, 0, inherit))
         {
             return(true);
         }
         method = method.GetParentDefinition();
     }
     return(false);
 }
 internal static bool IsDefined(RuntimeType type, RuntimeType caType, bool inherit)
 {
     if (type.GetElementType() != null)
     {
         return(false);
     }
     if (PseudoCustomAttribute.IsDefined(type, caType))
     {
         return(true);
     }
     if (CustomAttribute.IsCustomAttributeDefined(type.GetRuntimeModule(), type.MetadataToken, caType))
     {
         return(true);
     }
     if (!inherit)
     {
         return(false);
     }
     type = (type.BaseType as RuntimeType);
     while (type != null)
     {
         if (CustomAttribute.IsCustomAttributeDefined(type.GetRuntimeModule(), type.MetadataToken, caType, 0, inherit))
         {
             return(true);
         }
         type = (type.BaseType as RuntimeType);
     }
     return(false);
 }
Exemplo n.º 3
0
 internal static bool IsDefined(RuntimeFieldInfo field, RuntimeType caType)
 {
     if (PseudoCustomAttribute.IsDefined(field, caType))
     {
         return(true);
     }
     return(CustomAttribute.IsCustomAttributeDefined(field.GetRuntimeModule(), field.MetadataToken, caType));
 }
Exemplo n.º 4
0
 internal static bool IsDefined(RuntimeEventInfo e, RuntimeType caType)
 {
     if (PseudoCustomAttribute.IsDefined(e, caType))
     {
         return(true);
     }
     return(CustomAttribute.IsCustomAttributeDefined(e.GetRuntimeModule(), e.MetadataToken, caType));
 }
Exemplo n.º 5
0
 internal static bool IsDefined(RuntimePropertyInfo property, RuntimeType caType)
 {
     if (PseudoCustomAttribute.IsDefined(property, caType))
     {
         return(true);
     }
     return(CustomAttribute.IsCustomAttributeDefined(property.GetRuntimeModule(), property.MetadataToken, caType));
 }
Exemplo n.º 6
0
 internal static bool IsDefined(RuntimeConstructorInfo ctor, RuntimeType caType)
 {
     if (PseudoCustomAttribute.IsDefined(ctor, caType))
     {
         return(true);
     }
     return(CustomAttribute.IsCustomAttributeDefined(ctor.GetRuntimeModule(), ctor.MetadataToken, caType));
 }
Exemplo n.º 7
0
 internal static bool IsDefined(RuntimeAssembly assembly, RuntimeType caType)
 {
     if (PseudoCustomAttribute.IsDefined(assembly, caType))
     {
         return(true);
     }
     return(CustomAttribute.IsCustomAttributeDefined(assembly.ManifestModule as RuntimeModule, RuntimeAssembly.GetToken(assembly.GetNativeHandle()), caType));
 }
Exemplo n.º 8
0
 internal static bool IsDefined(RuntimeParameterInfo parameter, RuntimeType caType)
 {
     if (PseudoCustomAttribute.IsDefined(parameter, caType))
     {
         return(true);
     }
     return(CustomAttribute.IsCustomAttributeDefined(parameter.GetRuntimeModule(), parameter.MetadataToken, caType));
 }
Exemplo n.º 9
0
        internal static bool IsDefined(RuntimeModule module, RuntimeType caType)
        {
            if (PseudoCustomAttribute.IsDefined(module, caType))
            {
                return(true);
            }
            RuntimeModule decoratedModule     = module;
            int           metadataToken       = decoratedModule.MetadataToken;
            RuntimeType   attributeFilterType = caType;

            return(CustomAttribute.IsCustomAttributeDefined(decoratedModule, metadataToken, attributeFilterType));
        }
Exemplo n.º 10
0
 private static bool IsCustomAttributeDefined(RuntimeModule decoratedModule, int decoratedMetadataToken, RuntimeType attributeFilterType)
 {
     return(CustomAttribute.IsCustomAttributeDefined(decoratedModule, decoratedMetadataToken, attributeFilterType, 0, false));
 }
Exemplo n.º 11
0
 internal static bool IsAttributeDefined(RuntimeModule decoratedModule, int decoratedMetadataToken, int attributeCtorToken)
 {
     return(CustomAttribute.IsCustomAttributeDefined(decoratedModule, decoratedMetadataToken, (RuntimeType)null, attributeCtorToken, false));
 }
 internal static bool IsDefined(RuntimeModule module, RuntimeType caType)
 {
     return(PseudoCustomAttribute.IsDefined(module, caType) || CustomAttribute.IsCustomAttributeDefined(module, module.MetadataToken, caType));
 }