mirror of
https://github.com/sochix/TLSharp.git
synced 2026-04-06 06:55:06 +00:00
Generator Must Respect MS .NET API guidelines
This commit is contained in:
parent
3ba3ea53fd
commit
d769dd3c2f
646 changed files with 7213 additions and 7166 deletions
|
|
@ -18,40 +18,40 @@ namespace TeleSharp.TL
|
|||
}
|
||||
}
|
||||
|
||||
public int flags { get; set; }
|
||||
public string currency { get; set; }
|
||||
public long total_amount { get; set; }
|
||||
public byte[] payload { get; set; }
|
||||
public TLPaymentRequestedInfo info { get; set; }
|
||||
public string shipping_option_id { get; set; }
|
||||
public TLPaymentCharge charge { get; set; }
|
||||
public int Flags { get; set; }
|
||||
public string Currency { get; set; }
|
||||
public long TotalAmount { get; set; }
|
||||
public byte[] Payload { get; set; }
|
||||
public TLPaymentRequestedInfo Info { get; set; }
|
||||
public string ShippingOptionId { get; set; }
|
||||
public TLPaymentCharge Charge { get; set; }
|
||||
|
||||
|
||||
public void ComputeFlags()
|
||||
{
|
||||
flags = 0;
|
||||
flags = info != null ? (flags | 1) : (flags & ~1);
|
||||
flags = shipping_option_id != null ? (flags | 2) : (flags & ~2);
|
||||
Flags = 0;
|
||||
Flags = Info != null ? (Flags | 1) : (Flags & ~1);
|
||||
Flags = ShippingOptionId != null ? (Flags | 2) : (Flags & ~2);
|
||||
|
||||
}
|
||||
|
||||
public override void DeserializeBody(BinaryReader br)
|
||||
{
|
||||
flags = br.ReadInt32();
|
||||
currency = StringUtil.Deserialize(br);
|
||||
total_amount = br.ReadInt64();
|
||||
payload = BytesUtil.Deserialize(br);
|
||||
if ((flags & 1) != 0)
|
||||
info = (TLPaymentRequestedInfo)ObjectUtils.DeserializeObject(br);
|
||||
Flags = br.ReadInt32();
|
||||
Currency = StringUtil.Deserialize(br);
|
||||
TotalAmount = br.ReadInt64();
|
||||
Payload = BytesUtil.Deserialize(br);
|
||||
if ((Flags & 1) != 0)
|
||||
Info = (TLPaymentRequestedInfo)ObjectUtils.DeserializeObject(br);
|
||||
else
|
||||
info = null;
|
||||
Info = null;
|
||||
|
||||
if ((flags & 2) != 0)
|
||||
shipping_option_id = StringUtil.Deserialize(br);
|
||||
if ((Flags & 2) != 0)
|
||||
ShippingOptionId = StringUtil.Deserialize(br);
|
||||
else
|
||||
shipping_option_id = null;
|
||||
ShippingOptionId = null;
|
||||
|
||||
charge = (TLPaymentCharge)ObjectUtils.DeserializeObject(br);
|
||||
Charge = (TLPaymentCharge)ObjectUtils.DeserializeObject(br);
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -59,15 +59,15 @@ namespace TeleSharp.TL
|
|||
{
|
||||
bw.Write(Constructor);
|
||||
ComputeFlags();
|
||||
bw.Write(flags);
|
||||
StringUtil.Serialize(currency, bw);
|
||||
bw.Write(total_amount);
|
||||
BytesUtil.Serialize(payload, bw);
|
||||
if ((flags & 1) != 0)
|
||||
ObjectUtils.SerializeObject(info, bw);
|
||||
if ((flags & 2) != 0)
|
||||
StringUtil.Serialize(shipping_option_id, bw);
|
||||
ObjectUtils.SerializeObject(charge, bw);
|
||||
bw.Write(Flags);
|
||||
StringUtil.Serialize(Currency, bw);
|
||||
bw.Write(TotalAmount);
|
||||
BytesUtil.Serialize(Payload, bw);
|
||||
if ((Flags & 1) != 0)
|
||||
ObjectUtils.SerializeObject(Info, bw);
|
||||
if ((Flags & 2) != 0)
|
||||
StringUtil.Serialize(ShippingOptionId, bw);
|
||||
ObjectUtils.SerializeObject(Charge, bw);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue