示例#1
0
 public override void Write(TLBinaryWriter to)
 {
     to.WriteInt32(UserId);
     to.WriteInt32(Date);
     to.WriteObject(Photo);
     to.WriteBoolean(Previous);
 }
 public override void Write(TLBinaryWriter to)
 {
     to.WriteInt32(ChatId);
     to.WriteInt32(UserId);
     to.WriteBoolean(IsAdmin);
     to.WriteInt32(Version);
 }
示例#3
0
        public static void Write <T>(TLBinaryWriter to, object value)
        {
            if (value == null)
            {
                to.WriteUInt32(0x56730BCC);
                return;
            }

            var type = typeof(T);

            if (type == typeof(UInt32))
            {
                to.WriteUInt32((uint)value);
            }
            else if (type == typeof(Int32))
            {
                to.WriteInt32((int)value);
            }
            else if (type == typeof(UInt64))
            {
                to.WriteUInt64((ulong)value);
            }
            else if (type == typeof(Int64))
            {
                to.WriteInt64((long)value);
            }
            else if (type == typeof(Double))
            {
                to.WriteDouble((double)value);
            }
            else if (type == typeof(Boolean))
            {
                to.WriteBoolean((bool)value);
            }
            else if (type == typeof(String))
            {
                to.WriteString((string)value);
            }
            else if (type == typeof(Byte[]))
            {
                to.WriteByteArray((byte[])value);
            }
            else
            {
                to.WriteObject((TLObject)value);
            }
        }
示例#4
0
 public override void Write(TLBinaryWriter to)
 {
     to.WriteInt32(ChatId);
     to.WriteBoolean(Enabled);
     to.WriteInt32(Version);
 }
示例#5
0
 public override void Write(TLBinaryWriter to)
 {
     to.WriteBoolean(NewValue);
 }
示例#6
0
 public override void Write(TLBinaryWriter to)
 {
     to.WriteBoolean(Ordered);
     to.WriteObject(Items);
 }
示例#7
0
 public override void Write(TLBinaryWriter to)
 {
     to.WriteInt32(UserId);
     to.WriteBoolean(Blocked);
 }