Write() public method

public Write ( __BinaryWriter sout ) : void
sout __BinaryWriter
return void
コード例 #1
0
        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);
                }
            }
        }
コード例 #2
0
        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);
            }
        }