public void NewThread() { FeedbackThreadViewModel newThread = new FeedbackThreadViewModel(HockeyApp.HockeyClientWPF.Instance.CreateFeedbackThread()); this.FeedbackThreadList.Add(newThread); this.SelectedFeedbackThread = newThread; }
private async void loadFeedbackThreads() { foreach (string token in FeedbackToken.Get()) { FeedbackThreadViewModel fbThread = new FeedbackThreadViewModel(null); if (await fbThread.LoadThread(token)) { fbThread.DeletedOnServer += delegate(object sender, EventArgs args) { IWindowManager wm = IoC.Get <IWindowManager>(); wm.ShowMetroMessageBox("Feedback-Thread was deleted on the server!", "Deleted", System.Windows.MessageBoxButton.OK); this.FeedbackThreadList.Remove(fbThread); }; FeedbackThreadList.Add(fbThread); } } if (this.FeedbackThreadList.Count == 0) { this.NewThread(); } //this.FeedbackThreadList.Add(new AddFeedbackThreadViewModel()); this.SelectedFeedbackThread = this.FeedbackThreadList.FirstOrDefault(); }
public NewFeedbackMessage(FeedbackThreadViewModel fbThreadVM) : base(null) { this._fbThreadVM = fbThreadVM; this.Username = HockeyApp.AppLoader.Properties.Settings.Default.LastFeedbackUserName; this.EMail = HockeyApp.AppLoader.Properties.Settings.Default.LastFeedbackUserEMail; if (this.IsNewThread) { this.Subject = "New Subject"; } else { this.Subject = _fbThreadVM.FeedbackMessages.Last().Subject; } }
public void CloseThread() { IWindowManager wm = IoC.Get <IWindowManager>(); if (wm.ShowMetroMessageBox("Thread will be closed and cannot be opened later. Continue anyway?", "Close thread", System.Windows.MessageBoxButton.YesNo) == System.Windows.MessageBoxResult.Yes) { FeedbackToken.DeleteToken(this.SelectedFeedbackThread.FeedbackThread.Token); int pos = this.FeedbackThreadList.IndexOf(this.SelectedFeedbackThread); this.FeedbackThreadList.Remove(this.SelectedFeedbackThread); if (this.FeedbackThreadList.Count >= pos + 1) { this.SelectedFeedbackThread = this.FeedbackThreadList[pos]; } else if (this.FeedbackThreadList.Count > 0) { this.SelectedFeedbackThread = this.FeedbackThreadList[this.FeedbackThreadList.Count - 1]; } else { this.NewThread(); } } }
public NewFeedbackMessage(FeedbackThreadViewModel fbThreadVM):base(null){ this._fbThreadVM = fbThreadVM; this.Username = HockeyApp.AppLoader.Properties.Settings.Default.LastFeedbackUserName; this.EMail = HockeyApp.AppLoader.Properties.Settings.Default.LastFeedbackUserEMail; if (this.IsNewThread) { this.Subject = "New Subject"; } else { this.Subject = _fbThreadVM.FeedbackMessages.Last().Subject; } }