Init() private method

private Init ( ) : void
return void
示例#1
0
        // Transforms a type to the serialized string form. URT Primitive types are converted to XMLData Types
        private NameInfo TypeToNameInfo(Type type, WriteObjectInfo objectInfo, InternalPrimitiveTypeE code, NameInfo nameInfo)
        {
            InternalST.Soap( this, "TypeToNameInfo Entry type ",type,", objectInfo ",objectInfo,", code ", ((Enum)code).ToString());
            if (nameInfo == null)
                nameInfo = GetNameInfo();
            else
                nameInfo.Init();

            nameInfo.NIisSealed = type.IsSealed;

            String typeName = null;
            nameInfo.NInameSpaceEnum = Converter.GetNameSpaceEnum(code, type, objectInfo, out typeName);
            nameInfo.NIprimitiveTypeEnum = code;
            nameInfo.NItype = type;
            nameInfo.NIname = typeName;
            if (objectInfo != null)
            {
                nameInfo.NIattributeInfo = objectInfo.typeAttributeInfo;                    
                nameInfo.NIassemId = objectInfo.assemId;
            }

            switch (nameInfo.NInameSpaceEnum)
            {
                case InternalNameSpaceE.XdrPrimitive:
                    break;
                case InternalNameSpaceE.XdrString:
                    nameInfo.NIname = "string";
                    break;
                case InternalNameSpaceE.UrtSystem:
                    break;
                case InternalNameSpaceE.UrtUser:
                    //if (type.FullName.StartsWith("System."))
                    if (type.Module.Assembly == Converter.urtAssembly)
                    {
                        // The type name could be an ISerializable
                        // But the type returned (typeName) could be a fake
                        // type
                    }
                    else
                    {
                        if (objectInfo == null)
                        {
                            InternalST.Soap( this, "TypeToNameInfo ObjectInfo is null 2 ",type);
                        }
                    }
                    break;
            }

            InternalST.Soap( this, "TypeToNameInfo Exit ",type, " typeName "+nameInfo.NIname);
            return nameInfo;            
        }
        private NameInfo TypeToNameInfo(Type type, WriteObjectInfo objectInfo, InternalPrimitiveTypeE code, NameInfo nameInfo)
        {
            if (nameInfo == null)
            {
                nameInfo = this.GetNameInfo();
            }
            else
            {
                nameInfo.Init();
            }
            nameInfo.NIisSealed = type.IsSealed;
            string typeName = null;
            nameInfo.NInameSpaceEnum = Converter.GetNameSpaceEnum(code, type, objectInfo, out typeName);
            nameInfo.NIprimitiveTypeEnum = code;
            nameInfo.NItype = type;
            nameInfo.NIname = typeName;
            if (objectInfo != null)
            {
                nameInfo.NIattributeInfo = objectInfo.typeAttributeInfo;
                nameInfo.NIassemId = objectInfo.assemId;
            }
            switch (nameInfo.NInameSpaceEnum)
            {
                case InternalNameSpaceE.XdrPrimitive:
                case InternalNameSpaceE.UrtSystem:
                    return nameInfo;

                case InternalNameSpaceE.XdrString:
                    nameInfo.NIname = "string";
                    return nameInfo;

                case InternalNameSpaceE.UrtUser:
                    if (type.Module.Assembly == Converter.urtAssembly)
                    {
                    }
                    return nameInfo;
            }
            return nameInfo;
        }