示例#1
0
 RichEditCommand IRichEditCommandFactoryService.CreateCommand(RichEditCommandId id)
 {
     if (id.Equals(RichEditCommandId.InsertColumnBreak) || id.Equals(RichEditCommandId.InsertLineBreak) || id.Equals(RichEditCommandId.InsertPageBreak))
     {
         return(service.CreateCommand(RichEditCommandId.InsertParagraph));
     }
     return(service.CreateCommand(id));
 }
示例#2
0
        private void richEditControl_PopupMenuShowing(object sender, PopupMenuShowingEventArgs e)
        {
            if ((e.MenuType & RichEditMenuType.TableCell) != 0)
            {
                // Remove the "Paste" menu item:
                e.Menu.RemoveMenuItem(RichEditCommandId.PasteSelection);

                // Disable the "Hyperlink..." menu item:
                e.Menu.DisableMenuItem(RichEditCommandId.CreateHyperlink);

                // Create a RichEdit command, which inserts an inline picture into a document:
                IRichEditCommandFactoryService service = (IRichEditCommandFactoryService)richEditControl.GetService(typeof(IRichEditCommandFactoryService));
                RichEditCommand cmd = service.CreateCommand(RichEditCommandId.InsertPicture);

                //Create a menu item for the new command:
                RichEditMenuItemCommandWinAdapter menuItemCommandAdapter = new RichEditMenuItemCommandWinAdapter(cmd);
                RichEditMenuItem menuItem = (RichEditMenuItem)menuItemCommandAdapter.CreateMenuItem(DevExpress.Utils.Menu.DXMenuItemPriority.Normal);
                menuItem.BeginGroup = true;
                e.Menu.Items.Add(menuItem);

                // Insert a new item into the Richedit popup menu and handle its click event:
                RichEditMenuItem myItem = new RichEditMenuItem("Highlight Selection", new EventHandler(MyClickHandler));
                e.Menu.Items.Add(myItem);
            }
        }
        public RichEditCommand CreateCommand(RichEditCommandId id)
        {
            if (id == RichEditCommandId.FileSaveAs)
                return new CustomSaveDocumentAsCommand(control);

            return service.CreateCommand(id);
        }
 public RichEditCommand CreateCommand(RichEditCommandId id)
 {
     if (id == RichEditCommandId.FileSave)
     {
         return(new CustomSaveDocumentCommand(control));
     }
     return(service.CreateCommand(id));
 }
        public RichEditCommand CreateCommand(RichEditCommandId id)
        {
            if (id == RichEditCommandId.CopySelection && ((Form1)Application.OpenForms[0]).UseCustomCopy)
            {
                return(new CustomCopySelectionCommand(control));
            }
            if (id == RichEditCommandId.PasteSelection && ((Form1)Application.OpenForms[0]).UseCustomPaste)
            {
                return(new CustomPasteSelectionCommand(control));
            }

            return(service.CreateCommand(id));
        }
示例#6
0
 public RichEditCommand CreateCommand(RichEditCommandId id)
 {
     if (id == RichEditCommandId.FileSaveAs)
     {
         return(new CustomSaveDocumentAsCommand(control, Language, Extension));
     }
     if (id == RichEditCommandId.FileOpen)
     {
         return(new CustomOpendocumentcommand(control, Language, Extension));
     }
     if (id == RichEditCommandId.FileSave)
     {
         return(new CustomSaveDocumentcommand(control, Language, Extension));
     }
     return(service.CreateCommand(id));
 }
        public RichEditCommand CreateCommand(RichEditCommandId id)
        {
            if (id == RichEditCommandId.FileSave)
            {
                return(new CustomSaveDocumentCommand(_control, _journalTask, _journalPageDTORetriever));
            }

            if (id == RichEditCommandId.PasteSelection)
            {
                return(new CustomPasteSelectionCommand(_control));
            }

            if (id == RichEditCommandId.InsertTable)
            {
                return(new CustomInsertTableCommand(_control));
            }

            if (id == RichEditCommandId.CopySelection)
            {
                return(new CustomCopySelectionCommand(_control, _clipboardTask));
            }

            return(_service.CreateCommand(id));
        }