示例#1
0
        /// <summary>
        /// Creates new topic folder, it's subdir's and <SetModel.SelectedTopic>.rtf
        /// </summary>
        private void CreateTopic()
        {
            string newTopicName = _setView.InputNewTopicName.Text;

            SetModel.SelectedTopic = newTopicName; //Update selectedTopic to newly created

            //Prep folders for the new topic
            CreateTopicFolderStructure(SetModel.SelectedSet, newTopicName);

            string path = SaveTopic.Save(SetModel.SelectedSet, _setView.InputNewTopicName.Text); //Save file

            //TODO: Implement "Update videoListView.Items ON _setView.BtnNewOldTopicSave.Click
            using (StreamWriter sw = new StreamWriter(path))
            {
                sw.Write(_setView.MainContent.Rtf);
            }
            _setView.TopicListbox.Items.Clear();
            _setModel = StaticFactory.GetSelectedSetModel(SetModel.SelectedSet);
        }
示例#2
0
 public SetViewPresenter(MainView mainView, SetView setView)
 {
     _setView  = setView;
     _mainView = mainView;
     _mainView.btnDel.Click                 += BtnDelDeleteTopic_Click;
     _setView.btnCode.Click                 += BtnCode_Click;
     _setView.btnBold.Click                 += BtnBold_Click;
     _setView.btnUnderline.Click            += BtnUnderline_Click;
     _setView.btnItalic.Click               += BtnItalic_Click;
     _setView.MainContent.SelectionChanged  += MainContent_SelectionChanged;
     _setView.MainContent.KeyDown           += MainContent_KeyDown;
     _setView.btnClear.Click                += BtnClear_Click;
     _setView.InputNewTopicName.TextChanged += InputNewTopicName_TextChanged;
     _setView.btnNewOldTopicSave.Click      += OnBtnNewOldTopicSave_Click;
     _setModel = StaticFactory.GetSelectedSetModel(SetModel.SelectedSet);
     _setView.TopicListbox.MouseClick   += TopicListbox_MouseClicked;
     _setView.btnAddVideos.MouseClick   += BtnAddVideos_MouseClick;
     _setView.TopicListbox.SelectedIndex = 0;
     PopulateTopicListbox();
 }