Пример #1
0
 private void menuExit_Click(object sender, EventArgs e)
 {
     _com?.FinalizeApp();
 }
Пример #2
0
        private async void menu_Click(object sender, EventArgs e)
        {
            ToolStripMenuItem menuSel;

            menuSel = (ToolStripMenuItem)sender;

            if (menuSel == menuKNoteLab)
            {
                // For test ...
                var labForm = new LabForm(_com.Store);
                labForm.Show();
            }
            else if (menuSel == menuNewFolder)
            {
                _com.NewFolder();
            }
            else if (menuSel == menuEditFolder)
            {
                _com.EditFolder();
            }
            else if (menuSel == menuDeleteFolder)
            {
                _com.DeleteFolder();
            }
            else if (menuSel == menuRemoveRepositoryLink)
            {
                _com.RemoveRepositoryLink();
            }
            else if (menuSel == menuAddRepositoryLink)
            {
                _com.AddRepositoryLink();
            }
            else if (menuSel == menuCreateRepository)
            {
                _com.CreateRepository();
            }
            else if (menuSel == menuManagmentRepository)
            {
                _com.ManagmentRepository();
            }
            else if (menuSel == menuRefreshTreeFolders)
            {
                Text = "KaNote Managment";
                _com.RefreshRepositoryAndFolderTree();
            }
            else if (menuSel == menuEditNote)
            {
                _com.EditNote();
            }
            else if (menuSel == menuEditNoteAsPostIt)
            {
                _com.EditNotePostIt();
            }
            else if (menuSel == menuNewNote)
            {
                _com.AddNote();
            }
            else if (menuSel == menuNewNoteAsPostIt)
            {
                _com.AddNotePostIt();
            }
            else if (menuSel == menuDeleteNote)
            {
                _com.DeleteNote();
            }
            else if (menuSel == menuKntScriptConsole)
            {
                _com.ShowKntScriptConsole();
            }
            else if (menuSel == menuHide)
            {
                _com.HideKNoteManagment();
            }
            else if (menuSel == menuAbout)
            {
                _com.About();
            }
            else if (menuSel == menuHelpDoc)
            {
                _com.Help();
            }
            else if (menuSel == menuMoveSelectedNotes)
            {
                _com.MoveSelectedNotes();
            }
            else if (menuSel == menuAddTags)
            {
                _com.AddTagsSelectedNotes();
            }
            else if (menuSel == menuRemoveTags)
            {
                _com.RemoveTagsSelectedNotes();
            }
            else if (menuSel == menuExecuteKntScript)
            {
                _com.RunScriptSelectedNotes();
            }
            else if (menuSel == menuOptions)
            {
                _com.Options();
            }
            else if (menuSel == menuFoldersExplorer)
            {
                if (tabExplorers.SelectedIndex == 0)
                {
                    return;
                }
                SelectTab(0);
            }
            else if (menuSel == menuSearchPanel)
            {
                if (tabExplorers.SelectedIndex == 1)
                {
                    return;
                }
                SelectTab(1);
            }
            else if (menuSel == menuHeaderPanelVisible)
            {
                if (!panelSupManagment.Visible)
                {
                    Text = "KaNote Managment";
                }
                panelSupManagment.Visible = !panelSupManagment.Visible;
            }
            else if (menuSel == menuMainVisible)
            {
                menuMangment.Visible    = !menuMangment.Visible;
                menuMainVisible.Checked = !menuMainVisible.Checked;
            }
            else if (menuSel == menuToolbarVisible)
            {
                menuToolbarVisible.Checked = !menuToolbarVisible.Checked;
                toolBarManagment.Visible   = menuToolbarVisible.Checked;
            }
            else if (menuSel == menuVerticalPanelForNotes)
            {
                if (splitContainer2.Orientation == Orientation.Horizontal)
                {
                    splitContainer2.Orientation       = Orientation.Vertical;
                    menuVerticalPanelForNotes.Checked = true;
                }
                else
                {
                    splitContainer2.Orientation       = Orientation.Horizontal;
                    menuVerticalPanelForNotes.Checked = false;
                }
            }
            else if (menuSel == menuExit)
            {
                SaveViewSizeAndPosition();
                await _com.FinalizeApp();
            }
            else
            {
                MessageBox.Show("In construction ... ");
            }
        }