internal void WriteAssembly(String typeFullName, Type type, String assemblyString, int assemId, bool isNew, bool isInteropType) { SerTrace.Log(this, "WriteAssembly type ", type, ", id ", assemId, ", name ", assemblyString, ", isNew ", isNew); //If the file being tested wasn't built as an assembly, then we're going to get null back //for the assembly name. This is very unfortunate. InternalWriteItemNull(); if (assemblyString == null) { assemblyString = String.Empty; } if (isNew) { if (objectWriter.IsCrossAppDomain()) { if (crossAppDomainAssembly == null) { crossAppDomainAssembly = new BinaryCrossAppDomainAssembly(); } crossAppDomainAssembly.Set(assemId, objectWriter.CrossAppDomainArrayAdd(assemblyString)); crossAppDomainAssembly.Dump(); crossAppDomainAssembly.Write(this); } else { if (binaryAssembly == null) { binaryAssembly = new BinaryAssembly(); } binaryAssembly.Set(assemId, assemblyString); binaryAssembly.Dump(); binaryAssembly.Write(this); } } }
internal void ReadAssembly(BinaryHeaderEnum binaryHeaderEnum) { SerTrace.Log(this, "ReadAssembly"); BinaryAssembly record = new BinaryAssembly(); if (binaryHeaderEnum == BinaryHeaderEnum.CrossAppDomainAssembly) { BinaryCrossAppDomainAssembly crossAppDomainAssembly = new BinaryCrossAppDomainAssembly(); crossAppDomainAssembly.Read(this); crossAppDomainAssembly.Dump(); record.assemId = crossAppDomainAssembly.assemId; record.assemblyString = objectReader.CrossAppDomainArray(crossAppDomainAssembly.assemblyIndex) as String; if (record.assemblyString == null) { throw new SerializationException(String.Format(Environment.GetResourceString("Serialization_CrossAppDomainError"), "String", crossAppDomainAssembly.assemblyIndex)); } } else { record.Read(this); record.Dump(); } AssemIdToAssemblyTable[record.assemId] = new BinaryAssemblyInfo(record.assemblyString); }
internal void WriteAssembly(Type type, string assemblyString, int assemId, bool isNew) { this.InternalWriteItemNull(); if (assemblyString == null) { assemblyString = string.Empty; } if (isNew) { if (this.binaryAssembly == null) { this.binaryAssembly = new BinaryAssembly(); } this.binaryAssembly.Set(assemId, assemblyString); this.binaryAssembly.Dump(); this.binaryAssembly.Write(this); } }
internal void WriteAssembly(Type type, string assemblyString, int assemId, bool isNew) { //If the file being tested wasn't built as an assembly, then we're going to get null back //for the assembly name. This is very unfortunate. InternalWriteItemNull(); if (assemblyString == null) { assemblyString = string.Empty; } if (isNew) { if (_binaryAssembly == null) { _binaryAssembly = new BinaryAssembly(); } _binaryAssembly.Set(assemId, assemblyString); _binaryAssembly.Write(this); } }
internal void ReadAssembly(BinaryHeaderEnum binaryHeaderEnum) { var record = new BinaryAssembly(); if (binaryHeaderEnum == BinaryHeaderEnum.CrossAppDomainAssembly) { var crossAppDomainAssembly = new BinaryCrossAppDomainAssembly(); crossAppDomainAssembly.Read(this); record._assemId = crossAppDomainAssembly._assemId; record._assemblyString = _objectReader.CrossAppDomainArray(crossAppDomainAssembly._assemblyIndex) as string; if (record._assemblyString == null) { throw new SerializationException(SR.Format(SR.Serialization_CrossAppDomainError, "String", crossAppDomainAssembly._assemblyIndex)); } } else { record.Read(this); } AssemIdToAssemblyTable[record._assemId] = new BinaryAssemblyInfo(record._assemblyString); }
internal void WriteAssembly(Type type, String assemblyString, int assemId, bool isNew) { SerTrace.Log(this, "WriteAssembly type ", type, ", id ", assemId, ", name ", assemblyString, ", isNew ", isNew); //If the file being tested wasn't built as an assembly, then we're going to get null back //for the assembly name. This is very unfortunate. InternalWriteItemNull(); if (assemblyString == null) { assemblyString = String.Empty; } if (isNew) { if (binaryAssembly == null) { binaryAssembly = new BinaryAssembly(); } binaryAssembly.Set(assemId, assemblyString); binaryAssembly.Dump(); binaryAssembly.Write(this); } }
internal void ReadAssembly(BinaryHeaderEnum binaryHeaderEnum) { BinaryAssembly binaryAssembly = new BinaryAssembly(); if (binaryHeaderEnum == BinaryHeaderEnum.CrossAppDomainAssembly) { BinaryCrossAppDomainAssembly appDomainAssembly = new BinaryCrossAppDomainAssembly(); appDomainAssembly.Read(this); appDomainAssembly.Dump(); binaryAssembly.assemId = appDomainAssembly.assemId; binaryAssembly.assemblyString = this.objectReader.CrossAppDomainArray(appDomainAssembly.assemblyIndex) as string; if (binaryAssembly.assemblyString == null) { throw new SerializationException(Environment.GetResourceString("Serialization_CrossAppDomainError", (object)"String", (object)appDomainAssembly.assemblyIndex)); } } else { binaryAssembly.Read(this); binaryAssembly.Dump(); } this.AssemIdToAssemblyTable[binaryAssembly.assemId] = (object)new BinaryAssemblyInfo(binaryAssembly.assemblyString); }
internal void ReadAssembly(BinaryHeaderEnum binaryHeaderEnum) { SerTrace.Log( this, "ReadAssembly"); BinaryAssembly record = new BinaryAssembly(); if (binaryHeaderEnum == BinaryHeaderEnum.CrossAppDomainAssembly) { BinaryCrossAppDomainAssembly crossAppDomainAssembly = new BinaryCrossAppDomainAssembly(); crossAppDomainAssembly.Read(this); crossAppDomainAssembly.Dump(); record.assemId = crossAppDomainAssembly.assemId; record.assemblyString = objectReader.CrossAppDomainArray(crossAppDomainAssembly.assemblyIndex) as String; if (record.assemblyString == null) throw new SerializationException(Environment.GetResourceString("Serialization_CrossAppDomainError","String", crossAppDomainAssembly.assemblyIndex)); } else { record.Read(this); record.Dump(); } AssemIdToAssemblyTable[record.assemId] = new BinaryAssemblyInfo(record.assemblyString); }
internal void WriteAssembly(Type type, String assemblyString, int assemId, bool isNew) { SerTrace.Log( this,"WriteAssembly type ",type,", id ",assemId,", name ", assemblyString,", isNew ",isNew); //If the file being tested wasn't built as an assembly, then we're going to get null back //for the assembly name. This is very unfortunate. InternalWriteItemNull(); if (assemblyString==null) { assemblyString=String.Empty; } if (isNew) { if (binaryAssembly == null) binaryAssembly = new BinaryAssembly(); binaryAssembly.Set(assemId, assemblyString); binaryAssembly.Dump(); binaryAssembly.Write(this); } }
internal void WriteAssembly(String typeFullName, Type type, String assemblyString, int assemId, bool isNew, bool isInteropType) { SerTrace.Log( this,"WriteAssembly type ",type,", id ",assemId,", name ", assemblyString,", isNew ",isNew); //If the file being tested wasn't built as an assembly, then we're going to get null back //for the assembly name. This is very unfortunate. InternalWriteItemNull(); if (assemblyString==null) { assemblyString=String.Empty; } if (isNew) { if (objectWriter.IsCrossAppDomain()) { if (crossAppDomainAssembly == null) crossAppDomainAssembly = new BinaryCrossAppDomainAssembly(); crossAppDomainAssembly.Set(assemId, objectWriter.CrossAppDomainArrayAdd(assemblyString)); crossAppDomainAssembly.Dump(); crossAppDomainAssembly.Write(this); } else { if (binaryAssembly == null) binaryAssembly = new BinaryAssembly(); binaryAssembly.Set(assemId, assemblyString); binaryAssembly.Dump(); binaryAssembly.Write(this); } } }
internal void ReadAssembly(BinaryHeaderEnum binaryHeaderEnum) { BinaryAssembly assembly = new BinaryAssembly(); if (binaryHeaderEnum == BinaryHeaderEnum.CrossAppDomainAssembly) { BinaryCrossAppDomainAssembly assembly2 = new BinaryCrossAppDomainAssembly(); assembly2.Read(this); assembly2.Dump(); assembly.assemId = assembly2.assemId; assembly.assemblyString = this.objectReader.CrossAppDomainArray(assembly2.assemblyIndex) as string; if (assembly.assemblyString == null) { throw new SerializationException(Environment.GetResourceString("Serialization_CrossAppDomainError", new object[] { "String", assembly2.assemblyIndex })); } } else { assembly.Read(this); assembly.Dump(); } this.AssemIdToAssemblyTable[assembly.assemId] = new BinaryAssemblyInfo(assembly.assemblyString); }