System.Runtime.Serialization.Formatters.Binary.IOUtil.WriteWithCode C# (CSharp) Method

WriteWithCode() static private method

static private WriteWithCode ( Type type, Object value, __BinaryWriter sout ) : void
type System.Type
value Object
sout __BinaryWriter
return void
        internal static void WriteWithCode(Type type, Object value, __BinaryWriter sout)
        {
            if (type == null)
                sout.WriteByte((Byte)InternalPrimitiveTypeE.Null);
            else if (type == Converter.typeofString)
                WriteStringWithCode((String)value, sout);
            else
            {
                InternalPrimitiveTypeE code = Converter.ToCode(type);
                sout.WriteByte((Byte)code);
                sout.WriteValue(code, value);
            }
        }

Usage Example

示例#1
0
 // Token: 0x060052BF RID: 21183 RVA: 0x001228C8 File Offset: 0x00120AC8
 internal void Write(__BinaryWriter sout)
 {
     sout.WriteByte(21);
     sout.WriteInt32((int)this.messageEnum);
     IOUtil.WriteStringWithCode(this.methodName, sout);
     IOUtil.WriteStringWithCode(this.typeName, sout);
     if (IOUtil.FlagTest(this.messageEnum, MessageEnum.ContextInline))
     {
         IOUtil.WriteStringWithCode((string)this.callContext, sout);
     }
     if (IOUtil.FlagTest(this.messageEnum, MessageEnum.ArgsInline))
     {
         sout.WriteInt32(this.args.Length);
         for (int i = 0; i < this.args.Length; i++)
         {
             IOUtil.WriteWithCode(this.argTypes[i], this.args[i], sout);
         }
     }
 }
All Usage Examples Of System.Runtime.Serialization.Formatters.Binary.IOUtil::WriteWithCode