Exemplo n.º 1
0
        private void DeleteMessagesInternal(TLMessageBase lastMessage, IList <TLMessageBase> messages)
        {
            var cachedMessages = new TLVector <long>();
            var remoteMessages = new TLVector <int>();

            for (int i = 0; i < messages.Count; i++)
            {
                if (messages[i].RandomId.HasValue && messages[i].RandomId != 0L)
                {
                    cachedMessages.Add(messages[i].RandomId.Value);
                }
                if (messages[i].Id > 0)
                {
                    remoteMessages.Add(messages[i].Id);
                }
            }

            CacheService.DeleteMessages(Peer.ToPeer(), lastMessage, remoteMessages);
            CacheService.DeleteMessages(cachedMessages);

            var dialog = CacheService.GetDialog(_peer.ToPeer());

            if (dialog != null)
            {
                Aggregator.Publish(new MessagesRemovedEventArgs(dialog, messages));
            }

            Execute.BeginOnUIThread(() =>
            {
                for (int j = 0; j < messages.Count; j++)
                {
                    Media.All(x => x.Remove(messages[j] as TLMessage));
                    Files.All(x => x.Remove(messages[j] as TLMessage));
                    Links.All(x => x.Remove(messages[j] as TLMessage));
                    Music.All(x => x.Remove(messages[j] as TLMessage));
                }

                RaisePropertyChanged(() => With);
                SelectionMode = ListViewSelectionMode.None;

                //this.IsEmptyDialog = (this.Items.get_Count() == 0 && this.LazyItems.get_Count() == 0);
                //this.NotifyOfPropertyChange<TLObject>(() => this.With);
            });
        }
Exemplo n.º 2
0
 private void OnExtractAudioItem()
 {
     ExtractAudioAll = Links.All(link => link.ExtractAudio);
 }