private async void visualSingleVideoAddBtn_Click(object sender, RoutedEventArgs e) { if (SelectedTopic.IsVisualContentAllowed <SingleVideo>()) { await this.ShowOverlayAsync(); SingleVideoVisualForm svvf = new SingleVideoVisualForm((src, isCorrect) => { SelectedResolver.VisualContent = new SingleVideo() { Src = src, IsNormal = isCorrect }; visualAddBtn.IsEnabled = false; visualEditBtn.IsEnabled = true; visualRemoveBtn.IsEnabled = true; }, _current.Root.ID); svvf.Closed += async(a, b) => { await this.HideOverlayAsync(); this.Activate(); }; svvf.Owner = this; svvf.Show(); } else { await this.ShowMessageAsync(this.Title, SelectedTopic.VisualContentTypeMessage, MessageDialogStyle.Affirmative, new MetroDialogSettings() { AnimateShow = true, AnimateHide = true }); } }
private async void visualVideoPairAddBtn_Click(object sender, RoutedEventArgs e) { if (SelectedTopic.IsVisualContentAllowed <VideoPair>()) { await this.ShowOverlayAsync(); VideoPairVisualForm vpvf = new VideoPairVisualForm((correct, incorrect) => { SelectedResolver.VisualContent = new VideoPair() { correctSrc = correct, incorrectSrc = incorrect }; visualAddBtn.IsEnabled = false; visualEditBtn.IsEnabled = true; visualRemoveBtn.IsEnabled = true; }, _current.Root.ID); vpvf.Closed += async(a, b) => { await this.HideOverlayAsync(); this.Activate(); }; vpvf.Owner = this; vpvf.Show(); } else { await this.ShowMessageAsync(this.Title, SelectedTopic.VisualContentTypeMessage, MessageDialogStyle.Affirmative, new MetroDialogSettings() { AnimateShow = true, AnimateHide = true }); } }
private void ToggleFolding() { if (SelectedTopic != null) { SelectedTopic.Toggle(); } }
public virtual Topic AddConsequence() { if (SelectedTopic != null) { return(AddSubTopic(SelectedTopic.GetRoot(), SelectedTopic, TopicType.Consequence, true)); } return(null); }
public virtual Topic AddThreat() { if (SelectedTopic != null) { return(AddSubTopic(SelectedTopic.GetRoot(), SelectedTopic, TopicType.Threat, true)); } return(null); }
private void CollapseSelect(bool recursive) { if (SelectedTopic != null) { if (recursive) { SelectedTopic.CollapseAll(); } else { SelectedTopic.Collapse(); } } }
private void ExpandSelect(bool recursive) { if (SelectedTopic != null) { if (recursive) { SelectedTopic.ExpandAll(); } else { SelectedTopic.Expand(); } } }
private void TreeTopicBrowser_SelectedItemChanged(object sender, RoutedPropertyChangedEventArgs <object> e) { SelectedTopic = TopicPicker.SelectedTopic; if (SelectedTopic == null) { return; } var doc = new MarkdownDocument(); doc.Load(SelectedTopic.GetTopicFileName()); doc.RenderHtmlToFile(); PreviewBrowser.Navigate(doc.HtmlRenderFilename); }