Mono.Cecil.WindowsRuntimeProjections.IsWindowsAttributeUsageAttribute C# (CSharp) Method

IsWindowsAttributeUsageAttribute() static private method

static private IsWindowsAttributeUsageAttribute ( ICustomAttributeProvider owner, CustomAttribute attribute ) : bool
owner ICustomAttributeProvider
attribute CustomAttribute
return bool
        static bool IsWindowsAttributeUsageAttribute(ICustomAttributeProvider owner, CustomAttribute attribute)
        {
            if (owner.MetadataToken.TokenType != TokenType.TypeDef)
                return false;

            var constructor = attribute.Constructor;

            if (constructor.MetadataToken.TokenType != TokenType.MemberRef)
                return false;

            var declaring_type = constructor.DeclaringType;

            if (declaring_type.MetadataToken.TokenType != TokenType.TypeRef)
                return false;

            // declaring type is already projected
            return declaring_type.Name == "AttributeUsageAttribute" && declaring_type.Namespace == /*"Windows.Foundation.Metadata"*/"System";
        }