public virtual ContextMenuGroup Construct()
        {
            var spellCheckSuggestions = new ContextMenuGroup(ContextMenuGroupType.SpellCheckingCommands);
            var word = _incorrectWordInfo.Word;
            if (!_radRichTextBox.SpellChecker.CheckWordIsCorrect(word))
            {
                AddSpellCheckingSuggestions(spellCheckSuggestions, word);
                spellCheckSuggestions.Add(new RadMenuItem { IsSeparator = true });
                var radMenuItem1 = new RadMenuItem
                                       {
                                           Header = LocalizationManager.GetString("Documents_ContextMenu_SpellChecker_AddToDictionary"),
                                           IsEnabled = _radRichTextBox.SpellChecker.CanAddWord()
                                       };
                radMenuItem1.Click += AddToDictionaryMenuItem_Click;
                spellCheckSuggestions.Add(radMenuItem1);
                var radMenuItem2 = new RadMenuItem { Header = LocalizationManager.GetString("Documents_ContextMenu_SpellChecker_IgnoreWord") };
                radMenuItem2.Click += IgnoreMenuItem_Click;
                spellCheckSuggestions.Add(radMenuItem2);
                var radMenuItem3 = new RadMenuItem { Header = LocalizationManager.GetString("Documents_ContextMenu_SpellChecker_IgnoreAll") };
                radMenuItem3.Click += IgnoreAllMenuItem_Click;
                spellCheckSuggestions.Add(radMenuItem3);
                var menuItem = CreateMenuItem(LocalizationManager.GetString("Documents_ContextMenu_SpellChecker_ShowSpellCheckingDialog"), "16/EnableSpellCheck.png", _radRichTextBox.Commands.ShowSpellCheckingDialogCommand);
                spellCheckSuggestions.Add(menuItem);
            }

            return spellCheckSuggestions;
        }
예제 #2
0
 public ContextMenuOption(IText text, IEvent @event, ContextMenuGroup group, bool disabled = false)
 {
     Text     = text;
     Event    = @event;
     Group    = group;
     Disabled = disabled;
 }
예제 #3
0
        protected override ContextMenuGroup CreateImageCommands()
        {
            ContextMenuGroup imageCommands = new ContextMenuGroup(ContextMenuGroupType.ImageCommands);

            imageCommands.Add(RadMenuItemFactory.CreateMenuItem(LocalizationManager.GetString("Documents_ContextMenu_Image_InsertCaption"), "16/InsertCaption.png", this.radRichTextBox.Commands.ShowInsertCaptionDialogCommand));

            return(imageCommands);
        }
예제 #4
0
        public PublishedTree()
        {
            Id       = EyePatchApplication.SiteID + "EyePatchBlogPublishedTree";
            Remember = true;
            Defaults = new PublishedTreeDefaults();

            ContextMenu          = new ContextMenuGroup("ep.blog.buildPostTreeContext");
            ContextMenu.CssClass = "eyepatch-admin-context";
            ContextMenu.ContextMenus.Add(new PostContextMenu());
        }
예제 #5
0
        public MediaTree()
        {
            Id       = EyePatchApplication.SiteID + "EyePatchMeidaTree";
            Remember = true;

            Defaults = new MediatTreeDefaults();

            ContextMenu          = new ContextMenuGroup("ep.buildMediaTreeContext");
            ContextMenu.CssClass = "eyepatch-admin-context";
            ContextMenu.ContextMenus.Add(new MediaFolderContextMenu());
        }
        private List <ContextMenuGroup> GetContextMenuGroups(string ribbonId)
        {
            List <ContextMenuGroup> contextMenuGroups = new List <ContextMenuGroup>();
            ContextMenuGroup        pasteLab          = new ContextMenuGroup(ShortcutsLabText.PasteMenuLabel, new List <string>());
            ContextMenuGroup        shortcuts         = new ContextMenuGroup(ShortcutsLabText.ShortcutsMenuLabel, new List <string>());

            // All context menus will have these Shortcuts
            contextMenuGroups.Add(shortcuts);
            shortcuts.Items.Add(ShortcutsLabText.ExportSlideAsImageTag);

            // All context menus will other than slide thumbnails have these PasteLab buttons
            if (ribbonId != ShortcutsLabText.MenuThumbnail)
            {
                contextMenuGroups.Add(pasteLab);
                pasteLab.Items.Add(PasteLabText.PasteAtCursorPositionTag);
                pasteLab.Items.Add(PasteLabText.PasteAtOriginalPositionTag);
                pasteLab.Items.Add(PasteLabText.PasteToFillSlideTag);
                pasteLab.Items.Add(PasteLabText.PasteToFitSlideTag);
            }


            // Context menus other than slide and slide thumbnail will have these buttons
            if (ribbonId != ShortcutsLabText.MenuSlide && ribbonId != ShortcutsLabText.MenuThumbnail)
            {
                if (!ribbonId.Contains(ShortcutsLabText.MenuEditSmartArtBase) &&
                    ribbonId != ShortcutsLabText.MenuTextEdit &&
                    ribbonId != ShortcutsLabText.MenuTable)
                {
                    pasteLab.Items.Add(PasteLabText.ReplaceWithClipboardTag);
                }

                shortcuts.Items.Add(ShortcutsLabText.EditNameTag);

                // Context menus other than picture will have these buttons
                if (ribbonId != ShortcutsLabText.MenuPicture)
                {
                    shortcuts.Items.Add(ShortcutsLabText.ConvertToPictureTag);
                }

                shortcuts.Items.Add(ShortcutsLabText.HideShapeTag);
                shortcuts.Items.Add(ShortcutsLabText.AddCustomShapeTag);
                shortcuts.Items.Add(ShortcutsLabText.FillSlideTag);

                // Context menu group will have these buttons
                if (ribbonId == ShortcutsLabText.MenuGroup)
                {
                    pasteLab.Items.Add(PasteLabText.PasteIntoGroupTag);
                    shortcuts.Items.Add(ShortcutsLabText.AddIntoGroupTag);
                }
            }
            return(contextMenuGroups);
        }
예제 #7
0
파일: PageTree.cs 프로젝트: XFSDev/EyePatch
        public PageTree(Folder root)
        {
            Id       = EyePatchApplication.SiteID + "EyePatchPageTree";
            Remember = true;
            Defaults = new PageTreeDefaults();

            ContextMenu          = new ContextMenuGroup("ep.buildPageTreeContext");
            ContextMenu.CssClass = "eyepatch-admin-context";
            ContextMenu.ContextMenus.Add(new FolderContextMenu());
            ContextMenu.ContextMenus.Add(new PageContextMenu());

            Children.Add(new FolderNode(root));
        }
        private async void AddSpellCheckingSuggestions(ContextMenuGroup spellCheckSuggestions, string currentWord)
        {
            var loadingItem = new RadMenuItem { Header = LanguageService.Translate("Msg_Loading"), IsEnabled = false };
            spellCheckSuggestions.Add(loadingItem);

            var num = 0;
            var suggestions = await GetSuggestionsAsync(currentWord);

            var menu = loadingItem.Menu;
            var index = -1;

            if (menu != null)
            {
                index = menu.Items.IndexOf(loadingItem);
                menu.Items.Remove(loadingItem);
            }

            foreach (var str in suggestions)
            {
                var radMenuItem = new RadMenuItem { Header = str, FontWeight = FontWeights.Bold };
                radMenuItem.Click += SpellCheckSuggestionItem_Click;
                spellCheckSuggestions.Add(radMenuItem);

                if (menu != null && index >= 0)
                {
                    menu.Items.Insert(index + num, radMenuItem);
                }

                ++num;
                if (num >= 5)
                    break;
            }

            if (num != 0)
                return;
            var contextMenuGroup = spellCheckSuggestions;
            var radMenuItem1 = new RadMenuItem
                                   {
                                       Header = LocalizationManager.GetString("Documents_ContextMenu_SpellChecker_NoSpellingSuggestions"),
                                       IsEnabled = false
                                   };
            var radMenuItem2 = radMenuItem1;
            contextMenuGroup.Add(radMenuItem2);

            if (menu != null && index >= 0)
            {
                menu.Items.Insert(index, radMenuItem2);
            }
        }
        private static void ContextMenu_Showing(DocumentationStepView documentationStepView, object sender, ContextMenuEventArgs e)
        {
            if (e.ContextMenuGroupCollection.Any(c => c.Type == ContextMenuGroupType.Custom))
            {
                return;
            }

            var cmd = new Telerik.Windows.Documents.RichTextBoxCommands.InsertPictureCommand(documentationStepView.HTMLRichTextBox);
            var insertImageMenuItem = new RadMenuItem
                                          {
                                              Header = "Insert Image...",
                                              Command = cmd,
                                              Icon = new Image()
                                                      {
                                                          Source = new BitmapImage(new Uri("/Cebos.Veyron.Common.SL;component/Assets/Icons/presentation.png", UriKind.Relative)),
                                                          //// This is valid too, if the image is within the same assembly
                                                          //Source = new BitmapImage(new Uri("Images/MenuIcons/Clear.png", UriKind.Relative)),              
                                                          Stretch = Stretch.Fill
                                                      }
                                          };
            var customContextMenuGroup = new ContextMenuGroup { insertImageMenuItem };
            e.ContextMenuGroupCollection.Add(customContextMenuGroup);
        }