public override void ConfigureEditor(IEditor editor) { var facade = MemopadApplication.Instance; var editorHandle = new DefaultEditorHandle(); editorHandle.KeyMap = facade.KeySchema.MemoContentEditorKeyMap; editor.InstallEditorHandle(editorHandle); editor.InstallHandle( new MemoTableRuledLineHandle(() => Figure), HandleStickyKind.Always ); editor.InstallHandle( new MemoTableFrameHandle(), HandleStickyKind.SelectedIncludingChildren ); editor.InstallRole(new ContainerRole()); editor.InstallRole(new ResizeRole()); editor.InstallRole(new RemoveRole()); editor.InstallRole(new CopyRole()); editor.InstallRole(new ChangeRowHeightRole()); editor.InstallRole(new ChangeColumnWidthRole()); var export = new ExportRole(); export.RegisterExporter("Csv", ExportCsvFile); editor.InstallRole(export); }
public override void ConfigureEditor(IEditor editor) { var app = MemopadApplication.Instance; var containerRole = new ContainerRole(); editor.InstallRole(containerRole); { var pasteRole = containerRole.PasteRole; pasteRole.RegisterPaster(StyledTextConsts.BlocksAndInlinesFormat.Name, MemoEditorHelper.PasteBlocksAndInlines); pasteRole.RegisterPaster(DataFormats.CommaSeparatedValue, MemoEditorHelper.PasteCsv); pasteRole.RegisterPaster(DataFormats.Html, MemoEditorHelper.PasteHtml); pasteRole.RegisterPaster(DataFormats.EnhancedMetafile, MemoEditorHelper.PasteMetafile); pasteRole.RegisterPaster(DataFormats.Bitmap, MemoEditorHelper.PasteImage); pasteRole.RegisterPaster(DataFormats.FileDrop, MemoEditorHelper.PasteFileDrops); pasteRole.RegisterPaster(DataFormats.UnicodeText, MemoEditorHelper.PasteText); } editor.InstallRole(new CreateFreehandRole()); editor.InstallRole(new CreateChildCommentEdgeRole()); editor.InstallRole(new AdjustSpaceRole()); var editorHandle = new DefaultEditorHandle(); editorHandle.Cursor = Cursors.IBeam; var scenario = new MemoEditorScenario(editorHandle); scenario.Apply(); var facade = MemopadApplication.Instance; editorHandle.KeyMap = facade.KeySchema.MemoEditorKeyMap; editor.InstallEditorHandle(editorHandle); }