System.MonoCustomAttrs.IsDefinedInternal C# (CSharp) Метод

IsDefinedInternal() приватный Метод

private IsDefinedInternal ( ICustomAttributeProvider obj, Type AttributeType ) : bool
obj ICustomAttributeProvider
AttributeType Type
Результат bool
		internal static extern bool IsDefinedInternal (ICustomAttributeProvider obj, Type AttributeType);

Usage Example

Пример #1
0
        internal static bool IsDefined(ICustomAttributeProvider obj, Type attributeType, bool inherit)
        {
            if (attributeType == null)
            {
                throw new ArgumentNullException("attributeType");
            }
            if (MonoCustomAttrs.IsUserCattrProvider(obj))
            {
                return(obj.IsDefined(attributeType, inherit));
            }
            if (MonoCustomAttrs.IsDefinedInternal(obj, attributeType))
            {
                return(true);
            }
            object[] pseudoCustomAttributes = MonoCustomAttrs.GetPseudoCustomAttributes(obj, attributeType);
            if (pseudoCustomAttributes != null)
            {
                for (int i = 0; i < pseudoCustomAttributes.Length; i++)
                {
                    if (attributeType.IsAssignableFrom(pseudoCustomAttributes[i].GetType()))
                    {
                        return(true);
                    }
                }
            }
            ICustomAttributeProvider @base;

            return(inherit && (@base = MonoCustomAttrs.GetBase(obj)) != null && MonoCustomAttrs.IsDefined(@base, attributeType, inherit));
        }