Ejemplo n.º 1
0
        public ChallengeThumbnail(Stream s, GBXLBSContext context, GBXNodeRefList list) : base(context, list)
        {
            version = new GBXUInt(s);
            AddChildDeprecated(versionKey, version);

            if (version.Value == 0)
            {
                return;
            }
            //version > 0
            thumbSize = new GBXUInt(s);
            AddChildDeprecated(thumbSizeKey, thumbSize);

            thumbBegin = new GBXFixedLengthString(s, 15);
            AddChildDeprecated(thumbBeginKey, thumbBegin);

            thumb = new Unread(s, (int)thumbSize.Value);
            AddChildDeprecated(thumbKey, thumb);

            thumbEnd = new GBXFixedLengthString(s, 16);
            AddChildDeprecated(thumbEndKey, thumbEnd);

            commentBegin = new GBXFixedLengthString(s, 10);
            AddChildDeprecated(commentBeginKey, commentBegin);

            comment = new GBXString(s);
            AddChildDeprecated(commentKey, comment);

            commentEnd = new GBXFixedLengthString(s, 11);
            AddChildDeprecated(commentEndKey, commentEnd);
        }
        public Challenge03043049(Stream s, GBXLBSContext context, GBXNodeRefList list) : base(context, list)
        {
            //TODO Figure out what this is.
            var unknown = new Unread(s, 36);

            AddChildDeprecated(unknownKey, unknown);
        }
Ejemplo n.º 3
0
        public override void ToStream(Stream output)
        {
            output.Write(TLUtils.SignatureToBytes(Signature));
            output.Write(Flags.ToBytes());
            output.Write(RandomId.ToBytes());
            output.Write(TTL.ToBytes());
            output.Write(Message.ToBytes());
            ToStream(output, Media, Flags, (int)MessageFlags.Media);
            ToStream(output, Entities, Flags, (int)MessageFlags.Entities);
            ToStream(output, ViaBotName, Flags, (int)MessageFlags.ViaBotId);
            ToStream(output, ReplyToRandomMsgId, Flags, (int)MessageFlags.ReplyToMsgId);

            ChatId.NullableToStream(output);
            InputFile.NullableToStream(output);
            FromId.NullableToStream(output);
            Out.NullableToStream(output);
            Unread.NullableToStream(output);
            Date.NullableToStream(output);
            DeleteDate.NullableToStream(output);
            Qts.NullableToStream(output);

            var status = new TLInt((int)Status);

            output.Write(status.ToBytes());

            InSeqNo.NullableToStream(output);
            OutSeqNo.NullableToStream(output);
            CustomFlags.NullableToStream(output);

            if (IsSet(CustomFlags, (int)MessageCustomFlags.BotInlineResult))
            {
                _inlineBotResult.ToStream(output);
            }
        }
Ejemplo n.º 4
0
        public override void ToStream(Stream output)
        {
            output.Write(TLUtils.SignatureToBytes(Signature));
            output.Write(RandomId.ToBytes());
            output.Write(TTL.ToBytes());
            //output.Write(RandomBytes.ToBytes());
            output.Write(Message.ToBytes());
            Media.ToStream(output);

            ChatId.NullableToStream(output);
            InputFile.NullableToStream(output);
            FromId.NullableToStream(output);
            Out.NullableToStream(output);
            Unread.NullableToStream(output);
            Date.NullableToStream(output);
            DeleteDate.NullableToStream(output);
            Qts.NullableToStream(output);

            var status = new TLInt((int)Status);

            output.Write(status.ToBytes());

            InSeqNo.NullableToStream(output);
            OutSeqNo.NullableToStream(output);
            CustomFlags.NullableToStream(output);
        }
        public JsonValue ToJson(JsonSerializer serializer)
        {
            var json = new JsonObject();

            Id.Serialize(json, serializer, "id");
            Unread.Serialize(json, serializer, "unread");
            return(json);
        }
Ejemplo n.º 6
0
 public override byte[] ToBytes()
 {
     return(TLUtils.Combine(
                TLUtils.SignatureToBytes(Signature),
                HashValue.ToBytes(),
                SetsCovered.ToBytes(),
                Unread.ToBytes()));
 }
Ejemplo n.º 7
0
 private void InitializeItems()
 {
     All.Initialize();
     Unread.Initialize();
     Private_.Initialize();
     Public_.Initialize();
     Untagged.Initialize();
     Tagged.Initialize();
 }
Ejemplo n.º 8
0
 public override int GetHashCode()
 {
     return(PrimaryFolder.GetHashCode() ^ Unread.GetHashCode() ^ Attachments.GetHashCode() ^
            PeriodFrom.GetHashCode() ^ PeriodTo.GetHashCode() ^ Important.GetHashCode() ^
            FromAddress.GetHashCode() ^ MailboxId.GetHashCode() ^ CustomLabels.GetHashCode() ^
            Sort.GetHashCode() ^ SortOrder.GetHashCode() ^ SearchText.GetHashCode() ^
            Page.GetValueOrDefault() ^ PageSize.GetHashCode() ^ SetLabel.GetHashCode() ^
            WithCalendar.GetHashCode() ^ UserFolderId.GetHashCode() ^ FromDate.GetHashCode() ^
            FromMessage.GetHashCode() ^ PrevFlag.GetHashCode());
 }
Ejemplo n.º 9
0
        public override void ToStream(Stream output)
        {
            output.Write(TLUtils.SignatureToBytes(Signature));
            HashValue.ToStream(output);
            SetsCovered.ToStream(output);
            Unread.ToStream(output);

            Packs.ToStream(output);
            Documents.ToStream(output);
            MessagesStickerSets.ToStream(output);
        }
Ejemplo n.º 10
0
        public GBXFileRef(Stream s)
        {
            version = new GBXByte(s);

            if (version.Value >= 3)
            {
                checksum = new Unread(s, 32);
            }

            filePath = new GBXString(s);

            //TODO Condition not 100% clear.
            if (version.Value >= 1 && (filePath.Value.Length != 0 || version.Value >= 3))
            {
                locatorUrl = new GBXString(s);
            }
        }
Ejemplo n.º 11
0
        public override void ToStream(Stream output)
        {
            output.Write(TLUtils.SignatureToBytes(Signature));
            output.Write(RandomId.ToBytes());
            output.Write(RandomBytes.ToBytes());
            output.Write(Action.ToBytes());

            ChatId.NullableToStream(output);
            FromId.NullableToStream(output);
            Out.NullableToStream(output);
            Unread.NullableToStream(output);
            Date.NullableToStream(output);
            DeleteDate.NullableToStream(output);
            Qts.NullableToStream(output);

            var status = new TLInt((int)Status);

            output.Write(status.ToBytes());
        }
Ejemplo n.º 12
0
 private void AddNew_Load(object sender, EventArgs e)
 {
     AccountAvatar.Image     = Avatar;
     AccountMailAddress.Text = MailAdress;
     try
     {
         if (Convert.ToInt32(UnreadCount) > 0)
         {
             Unread.Text = UnreadCount;
         }
         else
         {
             Unread.Dispose();
         }
     }
     catch (Exception)
     {
         Unread.Text = UnreadCount;
     }
 }