Dump() public method

public Dump ( ) : void
return void
示例#1
0
        internal void ReadCrossAppDomainMap()
        {
            BinaryCrossAppDomainMap crossAppDomainMap = new BinaryCrossAppDomainMap();

            crossAppDomainMap.Read(this);
            crossAppDomainMap.Dump();
            object obj = this.objectReader.CrossAppDomainArray(crossAppDomainMap.crossAppDomainArrayIndex);
            BinaryObjectWithMap record1 = obj as BinaryObjectWithMap;

            if (record1 != null)
            {
                record1.Dump();
                this.ReadObjectWithMap(record1);
            }
            else
            {
                BinaryObjectWithMapTyped record2 = obj as BinaryObjectWithMapTyped;
                if (record2 != null)
                {
                    this.ReadObjectWithMapTyped(record2);
                }
                else
                {
                    throw new SerializationException(Environment.GetResourceString("Serialization_CrossAppDomainError", (object)"BinaryObjectMap", obj));
                }
            }
        }
        internal void ReadCrossAppDomainMap()
        {
            SerTrace.Log(this, "ReadObjectWithCrossAppDomainMap");
            BinaryCrossAppDomainMap record = new BinaryCrossAppDomainMap();

            record.Read(this);
            record.Dump();
            Object mapObject = objectReader.CrossAppDomainArray(record.crossAppDomainArrayIndex);
            BinaryObjectWithMap binaryObjectWithMap = mapObject as BinaryObjectWithMap;

            if (binaryObjectWithMap != null)
            {
                binaryObjectWithMap.Dump();
                ReadObjectWithMap(binaryObjectWithMap);
            }
            else
            {
                BinaryObjectWithMapTyped binaryObjectWithMapTyped = mapObject as BinaryObjectWithMapTyped;
                if (binaryObjectWithMapTyped != null)
                {
                    binaryObjectWithMapTyped.Dump();
                    ReadObjectWithMapTyped(binaryObjectWithMapTyped);
                }
                else
                {
                    throw new SerializationException(String.Format(Environment.GetResourceString("Serialization_CrossAppDomainError"), "BinaryObjectMap", mapObject));
                }
            }
        }
 internal void ReadObjectWithMap(BinaryHeaderEnum binaryHeaderEnum)
 {
     SerTrace.Log(this, "ReadObjectWithMap");
     if (bowm == null)
     {
         bowm = new BinaryObjectWithMap(binaryHeaderEnum);
     }
     else
     {
         bowm.binaryHeaderEnum = binaryHeaderEnum;
     }
     bowm.Read(this);
     bowm.Dump();
     ReadObjectWithMap(bowm);
 }
        internal void ReadCrossAppDomainMap()
        {
            BinaryCrossAppDomainMap map = new BinaryCrossAppDomainMap();

            map.Read(this);
            map.Dump();
            object obj2 = this.objectReader.CrossAppDomainArray(map.crossAppDomainArrayIndex);
            BinaryObjectWithMap record = obj2 as BinaryObjectWithMap;

            if (record != null)
            {
                record.Dump();
                this.ReadObjectWithMap(record);
            }
            else
            {
                BinaryObjectWithMapTyped typed = obj2 as BinaryObjectWithMapTyped;
                if (typed == null)
                {
                    throw new SerializationException(Environment.GetResourceString("Serialization_CrossAppDomainError", new object[] { "BinaryObjectMap", obj2 }));
                }
                this.ReadObjectWithMapTyped(typed);
            }
        }
示例#5
0
        //internal BinaryCrossAppDomainMap crossAppDomainMap;

        internal void WriteObject(NameInfo nameInfo, NameInfo typeNameInfo, int numMembers, String[] memberNames, Type[] memberTypes, WriteObjectInfo[] memberObjectInfos)
        {
            InternalWriteItemNull();
            int assemId;

            nameInfo.Dump("WriteObject nameInfo");
            typeNameInfo.Dump("WriteObject typeNameInfo");

            int objectId = (int)nameInfo.NIobjectId;

            //if (objectId < 0)
            //	objectId = --m_nestedObjectCount;

            if (objectId > 0)
            {
                BCLDebug.Trace("BINARY", "-----Top Level Object-----");
            }

            String objectName = null;

            if (objectId < 0)
            {
                // Nested Object
                objectName = typeNameInfo.NIname;
            }
            else
            {
                // Non-Nested
                objectName = nameInfo.NIname;
            }
            SerTrace.Log(this, "WriteObject objectName ", objectName);

            if (objectMapTable == null)
            {
                objectMapTable = new Hashtable();
            }

            ObjectMapInfo objectMapInfo = (ObjectMapInfo)objectMapTable[objectName];

            if (objectMapInfo != null && objectMapInfo.isCompatible(numMembers, memberNames, memberTypes))
            {
                // Object
                if (binaryObject == null)
                {
                    binaryObject = new BinaryObject();
                }
                binaryObject.Set(objectId, objectMapInfo.objectId);
                binaryObject.Dump();
                binaryObject.Write(this);
            }
            else if (!typeNameInfo.NItransmitTypeOnObject)
            {
                // ObjectWithMap
                if (binaryObjectWithMap == null)
                {
                    binaryObjectWithMap = new BinaryObjectWithMap();
                }

                // BCL types are not placed into table
                assemId = (int)typeNameInfo.NIassemId;
                binaryObjectWithMap.Set(objectId, objectName, numMembers, memberNames, assemId);

                binaryObjectWithMap.Dump();
                binaryObjectWithMap.Write(this);
                if (objectMapInfo == null)
                {
                    objectMapTable.Add(objectName, new ObjectMapInfo(objectId, numMembers, memberNames, memberTypes));
                }
            }
            else
            {
                // ObjectWithMapTyped
                BinaryTypeEnum[] binaryTypeEnumA  = new BinaryTypeEnum[numMembers];
                Object[]         typeInformationA = new Object[numMembers];
                int[]            assemIdA         = new int[numMembers];
                for (int i = 0; i < numMembers; i++)
                {
                    Object typeInformation = null;

                    binaryTypeEnumA[i]  = BinaryConverter.GetBinaryTypeInfo(memberTypes[i], memberObjectInfos[i], null, objectWriter, out typeInformation, out assemId);
                    typeInformationA[i] = typeInformation;
                    assemIdA[i]         = assemId;
                    SerTrace.Log(this, "WriteObject ObjectWithMapTyped memberNames "
                                 , memberNames[i], ", memberType ", memberTypes[i], " binaryTypeEnum ", ((Enum)binaryTypeEnumA[i]).ToString()
                                 , ", typeInformation ", typeInformationA[i], " assemId ", assemIdA[i]);
                }

                if (binaryObjectWithMapTyped == null)
                {
                    binaryObjectWithMapTyped = new BinaryObjectWithMapTyped();
                }

                // BCL types are not placed in table
                assemId = (int)typeNameInfo.NIassemId;
                binaryObjectWithMapTyped.Set(objectId, objectName, numMembers, memberNames, binaryTypeEnumA, typeInformationA, assemIdA, assemId);

                binaryObjectWithMapTyped.Dump();
                binaryObjectWithMapTyped.Write(this);
                if (objectMapInfo == null)
                {
                    objectMapTable.Add(objectName, new ObjectMapInfo(objectId, numMembers, memberNames, memberTypes));
                }
            }
        }