public async Task SetTalkDmAsync(string screenName) { var talk = await TwitterUtil.GetTalkDmAsync(this.account.TokensData, screenName, this.maxId); if (talk.Count < 1) { return; } this.maxId = talk[talk.Count - 1].Id - 1; this.target = screenName; SetTalkDm(talk); this.isLoading = false; }
private async void Window_Loaded(object sender, RoutedEventArgs e) { try { this.talkDmViewer.Initialize(this, this.account); List <DirectMessage> talk = await TwitterUtil.GetTalkDmAsync(this.account.TokensData, this.target); this.talkDmViewer.SetTalkDm(talk); await this.talkDmViewer.SetTalkDmAsync(this.target); } catch (TwitterException tex) { MessageBox.Show(tex.Message, "Twitter Exception.", MessageBoxButton.OK, MessageBoxImage.Warning); } this.Activate(); }