GetQualifiedTypeName() static private method

static private GetQualifiedTypeName ( Type type ) : String
type System.Type
return String
Ejemplo n.º 1
0
        internal TypeInfo(RuntimeType typeOfObj)
        {
            this.ServerType = TypeInfo.GetQualifiedTypeName(typeOfObj);
            RuntimeType runtimeType = (RuntimeType)typeOfObj.BaseType;
            int         length      = 0;

            while ((Type)runtimeType != typeof(MarshalByRefObject) && runtimeType != (RuntimeType)null)
            {
                runtimeType = (RuntimeType)runtimeType.BaseType;
                ++length;
            }
            string[] strArray1 = (string[])null;
            if (length > 0)
            {
                strArray1 = new string[length];
                RuntimeType type = (RuntimeType)typeOfObj.BaseType;
                for (int index = 0; index < length; ++index)
                {
                    strArray1[index] = TypeInfo.GetQualifiedTypeName(type);
                    type             = (RuntimeType)type.BaseType;
                }
            }
            this.ServerHierarchy = strArray1;
            Type[]   interfaces  = typeOfObj.GetInterfaces();
            string[] strArray2   = (string[])null;
            bool     isInterface = typeOfObj.IsInterface;

            if ((uint)interfaces.Length > 0U | isInterface)
            {
                strArray2 = new string[interfaces.Length + (isInterface ? 1 : 0)];
                for (int index = 0; index < interfaces.Length; ++index)
                {
                    strArray2[index] = TypeInfo.GetQualifiedTypeName((RuntimeType)interfaces[index]);
                }
                if (isInterface)
                {
                    string[] strArray3         = strArray2;
                    int      index             = strArray3.Length - 1;
                    string   qualifiedTypeName = TypeInfo.GetQualifiedTypeName(typeOfObj);
                    strArray3[index] = qualifiedTypeName;
                }
            }
            this.InterfacesImplemented = strArray2;
        }
        internal TypeInfo(RuntimeType typeOfObj)
        {
            this.ServerType = TypeInfo.GetQualifiedTypeName(typeOfObj);
            RuntimeType runtimeType = (RuntimeType)typeOfObj.BaseType;
            int         num         = 0;

            while (runtimeType != typeof(MarshalByRefObject) && runtimeType != null)
            {
                runtimeType = (RuntimeType)runtimeType.BaseType;
                num++;
            }
            string[] array = null;
            if (num > 0)
            {
                array       = new string[num];
                runtimeType = (RuntimeType)typeOfObj.BaseType;
                for (int i = 0; i < num; i++)
                {
                    array[i]    = TypeInfo.GetQualifiedTypeName(runtimeType);
                    runtimeType = (RuntimeType)runtimeType.BaseType;
                }
            }
            this.ServerHierarchy = array;
            Type[]   interfaces  = typeOfObj.GetInterfaces();
            string[] array2      = null;
            bool     isInterface = typeOfObj.IsInterface;

            if (interfaces.Length != 0 || isInterface)
            {
                array2 = new string[interfaces.Length + (isInterface ? 1 : 0)];
                for (int j = 0; j < interfaces.Length; j++)
                {
                    array2[j] = TypeInfo.GetQualifiedTypeName((RuntimeType)interfaces[j]);
                }
                if (isInterface)
                {
                    array2[array2.Length - 1] = TypeInfo.GetQualifiedTypeName(typeOfObj);
                }
            }
            this.InterfacesImplemented = array2;
        }