예제 #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);
 }