Example #1
0
        public void AddToStickers(TLMessageBase messageBase)
        {
            if (messageBase == null)
            {
                return;
            }

            var message = messageBase as TLMessage;

            if (message == null)
            {
                return;
            }

            var mediaDocument = message.Media as TLMessageMediaDocument;

            if (mediaDocument == null)
            {
                return;
            }

            var document = mediaDocument.Document as TLDocument22;

            if (document != null)
            {
                var inputStickerSet = document.StickerSet;
                if (inputStickerSet != null)
                {
                    TelegramViewBase.NavigateToStickers(MTProtoService, StateService, inputStickerSet);
                }
            }
        }
Example #2
0
        public void Open()
        {
            var stickerSet = StickerSet as TLStickerSet32;

            if (stickerSet == null)
            {
                return;
            }

            TelegramViewBase.NavigateToStickers(MTProtoService, StateService, new TLInputStickerSetShortName {
                ShortName = stickerSet.ShortName
            },
                                                () =>
            {
                Items.Insert(0, stickerSet);
            },
                                                () =>
            {
                for (var index = 0; index < Items.Count; index++)
                {
                    var item = Items[index];
                    if (TLString.Equals(stickerSet.ShortName, item.ShortName, StringComparison.Ordinal))
                    {
                        Items.RemoveAt(index);
                        break;
                    }
                }
            });
        }