internal void WriteAssembly(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.Write(this); } }
internal void ReadAssembly(BinaryHeaderEnum binaryHeaderEnum) { BinaryAssembly assembly = new BinaryAssembly(); if (binaryHeaderEnum != BinaryHeaderEnum.CrossAppDomainAssembly) { assembly.Read(this); } else { BinaryCrossAppDomainAssembly assembly2 = new BinaryCrossAppDomainAssembly(); assembly2.Read(this); assembly._assemId = assembly2._assemId; assembly._assemblyString = objectReader.CrossAppDomainArrayAt(assembly2._assemblyIndex) as string; if (assembly._assemblyString == null) { throw new SerializationException(RemotingResources.SerializationCrossDomainError.Format(nameof(String), (int)assembly2._assemblyIndex)); } } AssemIdToAssemblyTable[assembly._assemId] = new BinaryAssemblyInfo(assembly._assemblyString); }