Beispiel #1
0
        /// <summary>
        /// Adds the view sub menu.
        /// </summary>
        /// <param name="menuItems">The menu item collection to add this menu item to.</param>
        /// <returns>The created menu.</returns>
        public MenuItem AddView(MenuItemCollection menuItems)
        {
            var view = menuItems.AddLabelItem("View");

            AddEnterFullScreen(view.MenuItems);
            return(view);
        }
Beispiel #2
0
        /// <summary>
        /// Adds a menu for the recent document actions.
        /// </summary>
        /// <param name="menuItems">The menu item collection to add this menu item to.</param>
        /// <param name="label">The label for the menu item.</param>
        /// <returns>The created menu item.</returns>
        public static MenuItem AddRecentDocumentsMenu(this MenuItemCollection menuItems, string label = "Open Recent")
        {
            var menu = menuItems.AddLabelItem(label);

            menu.MenuItems.AddClearRecentDocumentsItem();

            return(menu);
        }
Beispiel #3
0
        /// <summary>
        /// Adds a menu item for the quit applications action.
        /// </summary>
        /// <param name="menuItems">The menu item collection to add this menu item to.</param>
        /// <returns>The created menu item.</returns>
        public LabelMenuItem AddQuit(MenuItemCollection menuItems)
        {
            var item = menuItems.AddLabelItem("Quit");

            item.SetShortcut(ModifierKey.Super, Key.Q);
            item.Click += (s, e) => Application.Exit();

            return(item);
        }
        /// <summary>
        /// Adds a menu for the various speech actions.
        /// </summary>
        /// <param name="menuItems">The menu item collection to add this menu item to.</param>
        /// <param name="label">The label for the menu item.</param>
        /// <returns>The created menu item.</returns>
        public static MenuItem AddSpeechMenu(this MenuItemCollection menuItems, string label = "Speech")
        {
            var menu = menuItems.AddLabelItem(label);

            menu.MenuItems.AddStartSpeakingItem();
            menu.MenuItems.AddStopSpeakingItem();

            return(menu);
        }
Beispiel #5
0
        /// <summary>
        /// Adds the window sub menu.
        /// </summary>
        /// <param name="menuItems">The menu item collection to add this menu item to.</param>
        /// <returns>The created menu.</returns>
        public MenuItem AddWindow(MenuItemCollection menuItems)
        {
            var edit = menuItems.AddLabelItem("Window");

            AddMinimize(edit.MenuItems);
            AddZoom(edit.MenuItems);
            AddBringAllToFront(edit.MenuItems);
            return(edit);
        }
        /// <summary>
        /// Adds a menu for the various text transformation actions.
        /// </summary>
        /// <param name="menuItems">The menu item collection to add this menu item to.</param>
        /// <param name="label">The label for the menu item.</param>
        /// <returns>The created menu item.</returns>
        public static MenuItem AddTransformationsMenu(this MenuItemCollection menuItems, string label = "Transformations")
        {
            var menu = menuItems.AddLabelItem(label);

            menu.MenuItems.AddMakeUpperCaseItem();
            menu.MenuItems.AddMakeLowerCaseItem();
            menu.MenuItems.AddCapitalizeItem();

            return(menu);
        }
Beispiel #7
0
        /// <summary>
        /// Adds the edit sub menu.
        /// </summary>
        /// <param name="menuItems">The menu item collection to add this menu item to.</param>
        /// <returns>The created menu.</returns>
        public MenuItem AddEdit(MenuItemCollection menuItems)
        {
            var edit = menuItems.AddLabelItem("Edit");

            AddUndo(edit.MenuItems);
            AddRedo(edit.MenuItems);
            edit.MenuItems.AddSeparatorItem();
            AddCut(edit.MenuItems);
            AddCopy(edit.MenuItems);
            AddPaste(edit.MenuItems);
            AddSelectAll(edit.MenuItems);
            return(edit);
        }
Beispiel #8
0
        /// <summary>
        /// Adds the edit sub menu.
        /// </summary>
        /// <param name="menuItems">The menu item collection to add this menu item to.</param>
        /// <returns>The created menu.</returns>
        public MenuItem AddApp(MenuItemCollection menuItems)
        {
            var app = menuItems.AddLabelItem(string.Empty);

            AddAbout(app.MenuItems);
            app.MenuItems.AddSeparatorItem();
            AddHide(app.MenuItems);
            AddHideOtherApplications(app.MenuItems);
            AddUnhideAllApplications(app.MenuItems);
            app.MenuItems.AddSeparatorItem();
            AddQuit(app.MenuItems);
            return(app);
        }
        /// <summary>
        /// Adds a menu for the various find actions.
        /// </summary>
        /// <param name="menuItems">The menu item collection to add this menu item to.</param>
        /// <param name="label">The label for the menu item.</param>
        /// <returns>The created menu item.</returns>
        public static MenuItem AddSpellingAndGrammarMenu(this MenuItemCollection menuItems, string label = "Spelling and Grammar")
        {
            var menu = menuItems.AddLabelItem(label);

            menu.MenuItems.AddShowSpellingAndGrammarItem();
            menu.MenuItems.AddCheckDocumentNowItem();
            menu.MenuItems.AddSeparatorItem();
            menu.MenuItems.AddCheckSpellingWhileTypingItem();
            menu.MenuItems.AddCheckGrammarWithSpellingItem();
            menu.MenuItems.AddCorrectSpellingAutomaticallyItem();

            return(menu);
        }
        /// <summary>
        /// Adds a menu for the various find actions.
        /// </summary>
        /// <param name="menuItems">The menu item collection to add this menu item to.</param>
        /// <param name="label">The label for the menu item.</param>
        /// <returns>The created menu item.</returns>
        public static MenuItem AddFindMenu(this MenuItemCollection menuItems, string label = "Find")
        {
            var menu = menuItems.AddLabelItem(label);

            menu.MenuItems.AddFindItem();
            menu.MenuItems.AddFindAndReplaceItem();
            menu.MenuItems.AddFindNextItem();
            menu.MenuItems.AddFindPreviousItem();
            menu.MenuItems.AddUseSelectionForFindItem();
            menu.MenuItems.AddJumpToSelectionItem();

            return(menu);
        }
        /// <summary>
        /// Adds a menu item for the quit applications action.
        /// </summary>
        /// <param name="menuItems">The menu item collection to add this menu item to.</param>
        /// <param name="label">The label for the menu item.</param>
        /// <returns>The created menu item.</returns>
        public static MenuItem AddQuitItem(this MenuItemCollection menuItems, string label = "Quit")
        {
            if (label == null)
            {
                throw new ArgumentNullException(nameof(label));
            }

            var item = menuItems.AddLabelItem(label);

            item.SetShortcut(ModifierKey.Super, Key.Q);
            item.Click += (s, e) => Application.Exit();

            return(item);
        }
        /// <summary>
        /// Adds a menu for the various substitution actions.
        /// </summary>
        /// <param name="menuItems">The menu item collection to add this menu item to.</param>
        /// <param name="label">The label for the menu item.</param>
        /// <returns>The created menu item.</returns>
        public static MenuItem AddSubstitutionsMenu(this MenuItemCollection menuItems, string label = "Substitutions")
        {
            var menu = menuItems.AddLabelItem(label);

            menu.MenuItems.AddShowSubstitutionsItem();
            menu.MenuItems.AddSeparatorItem();
            menu.MenuItems.AddSmartCopyPasteItem();
            menu.MenuItems.AddSmartQuotesItem();
            menu.MenuItems.AddSmartDashesItem();
            menu.MenuItems.AddSmartLinksItem();
            menu.MenuItems.AddDataDetectorsItem();
            menu.MenuItems.AddTextReplacementItem();

            return(menu);
        }