private static Type GetAssociateMetadataTypeFromAttribute(Type type)
        {
            Type metadataTypeAttributeType = GetMetadataTypeAttributeType();

            if (metadataTypeAttributeType == null)
            {
                return(null);
            }
            object obj = type.GetCustomAttributes(metadataTypeAttributeType, inherit: true).SingleOrDefault();

            if (obj == null)
            {
                return(null);
            }
            object obj2;

            if (DynamicCodeGeneration)
            {
                IMetadataTypeAttribute metadataTypeAttribute = DynamicWrapper.CreateWrapper <IMetadataTypeAttribute>(obj);
                obj2 = metadataTypeAttribute;
            }
            else
            {
                obj2 = new LateBoundMetadataTypeAttribute(obj);
            }
            IMetadataTypeAttribute metadataTypeAttribute2 = (IMetadataTypeAttribute)obj2;

            return(metadataTypeAttribute2.MetadataClassType);
        }
Esempio n. 2
0
        private static Type GetAssociateMetadataTypeFromAttribute(Type type)
        {
            Type metadataTypeAttributeType = GetMetadataTypeAttributeType();

            if (metadataTypeAttributeType == null)
            {
                return(null);
            }

            object attribute = type.GetCustomAttributes(metadataTypeAttributeType, true).SingleOrDefault();

            if (attribute == null)
            {
                return(null);
            }

#if (UNITY_IOS || UNITY_IPHONE || UNITY_ANDROID)
            IMetadataTypeAttribute metadataTypeAttribute = new LateBoundMetadataTypeAttribute(attribute);
#else
            IMetadataTypeAttribute metadataTypeAttribute = (DynamicCodeGeneration)
                                                       ? DynamicWrapper.CreateWrapper <IMetadataTypeAttribute>(attribute)
                                                       : new LateBoundMetadataTypeAttribute(attribute);
#endif

            return(metadataTypeAttribute.MetadataClassType);
        }
Esempio n. 3
0
        private static Type GetAssociateMetadataTypeFromAttribute(Type type)
        {
            Type metadataTypeAttributeType = JsonTypeReflector.GetMetadataTypeAttributeType();

            if (metadataTypeAttributeType == null)
            {
                return(null);
            }
            object obj = type.GetCustomAttributes(metadataTypeAttributeType, true).SingleOrDefault <object>();

            if (obj == null)
            {
                return(null);
            }
            IMetadataTypeAttribute metadataTypeAttribute = JsonTypeReflector.DynamicCodeGeneration ? DynamicWrapper.CreateWrapper <IMetadataTypeAttribute>(obj) : new LateBoundMetadataTypeAttribute(obj);

            return(metadataTypeAttribute.MetadataClassType);
        }
Esempio n. 4
0
        private static Type GetAssociateMetadataTypeFromAttribute(Type type)
        {
            Type metadataTypeAttributeType = GetMetadataTypeAttributeType();

            if (metadataTypeAttributeType == null)
            {
                return(null);
            }

            object attribute = type.GetCustomAttributes(metadataTypeAttributeType, true).SingleOrDefault();

            if (attribute == null)
            {
                return(null);
            }

            IMetadataTypeAttribute metadataTypeAttribute = DynamicWrapper.CreateWrapper <IMetadataTypeAttribute>(attribute);

            return(metadataTypeAttribute.MetadataClassType);
        }