Exemple #1
0
        public static RadObjectType FromSystemType(Type systemType)
        {
            RadObjectType type1;

            if (systemType == null)
            {
                throw new ArgumentNullException("systemType");
            }
            if (!typeof(RadObject).IsAssignableFrom(systemType))
            {
                throw new ArgumentException("DTypeNotSupportForSystemType");
            }
            Queue queue1 = null;

            lock (RadObjectType._lock)
            {
                type1 = RadObjectType.FromSystemTypeRecursive(systemType, ref queue1);
                goto Label_0071;
            }
Label_0061:
            RuntimeHelpers.RunClassConstructor((RuntimeTypeHandle)queue1.Dequeue());
Label_0071:
            if ((queue1 == null) || (queue1.Count <= 0))
            {
                return(type1);
            }
            goto Label_0061;
        }
Exemple #2
0
        public static RadObjectType FromSystemType(Type systemType)
        {
            if ((object)systemType == null)
            {
                throw new ArgumentNullException(nameof(systemType));
            }
            if (!typeof(RadObject).IsAssignableFrom(systemType))
            {
                throw new ArgumentException("DTypeNotSupportForSystemType");
            }
            Queue         encounteredTypes = (Queue)null;
            RadObjectType radObjectType;

            lock (RadObjectType._lock)
                radObjectType = RadObjectType.FromSystemTypeRecursive(systemType, ref encounteredTypes);
            while (encounteredTypes != null && encounteredTypes.Count > 0)
            {
                RuntimeHelpers.RunClassConstructor((RuntimeTypeHandle)encounteredTypes.Dequeue());
            }
            return(radObjectType);
        }
Exemple #3
0
        private static RadObjectType FromSystemTypeRecursive(Type systemType, ref Queue encounteredTypes)
        {
            RadObjectType type1 = (RadObjectType)RadObjectType.DTypeFromCLRType[systemType];

            if (type1 == null)
            {
                if (encounteredTypes == null)
                {
                    encounteredTypes = new Queue(10);
                }
                type1             = new RadObjectType();
                type1._systemType = systemType;
                RadObjectType.DTypeFromCLRType[systemType] = type1;
                if (systemType != typeof(RadObject))
                {
                    type1._baseDType = RadObjectType.FromSystemTypeRecursive(systemType.BaseType, ref encounteredTypes);
                }
                type1._id = RadObjectType.DTypeCount++;
                encounteredTypes.Enqueue(systemType.TypeHandle);
            }
            return(type1);
        }
Exemple #4
0
        private static RadObjectType FromSystemTypeRecursive(
            Type systemType,
            ref Queue encounteredTypes)
        {
            RadObjectType radObjectType = (RadObjectType)RadObjectType.DTypeFromCLRType[(object)systemType];

            if (radObjectType == null)
            {
                if (encounteredTypes == null)
                {
                    encounteredTypes = new Queue(10);
                }
                radObjectType             = new RadObjectType();
                radObjectType._systemType = systemType;
                RadObjectType.DTypeFromCLRType[(object)systemType] = (object)radObjectType;
                if ((object)systemType != (object)typeof(RadObject))
                {
                    radObjectType._baseDType = RadObjectType.FromSystemTypeRecursive(systemType.BaseType, ref encounteredTypes);
                }
                radObjectType._id = RadObjectType.DTypeCount++;
                encounteredTypes.Enqueue((object)systemType.TypeHandle);
            }
            return(radObjectType);
        }