Exemplo n.º 1
0
        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
                });
            }
        }
Exemplo n.º 2
0
        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
                });
            }
        }
Exemplo n.º 3
0
 private void ToggleFolding()
 {
     if (SelectedTopic != null)
     {
         SelectedTopic.Toggle();
     }
 }
Exemplo n.º 4
0
 public virtual Topic AddConsequence()
 {
     if (SelectedTopic != null)
     {
         return(AddSubTopic(SelectedTopic.GetRoot(), SelectedTopic, TopicType.Consequence, true));
     }
     return(null);
 }
Exemplo n.º 5
0
 public virtual Topic AddThreat()
 {
     if (SelectedTopic != null)
     {
         return(AddSubTopic(SelectedTopic.GetRoot(), SelectedTopic, TopicType.Threat, true));
     }
     return(null);
 }
Exemplo n.º 6
0
 private void CollapseSelect(bool recursive)
 {
     if (SelectedTopic != null)
     {
         if (recursive)
         {
             SelectedTopic.CollapseAll();
         }
         else
         {
             SelectedTopic.Collapse();
         }
     }
 }
Exemplo n.º 7
0
 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);
        }