InsertCtorDialog CreateDialog(InsertionContext context) { ITextEditor textEditor = context.TextArea.GetService(typeof(ITextEditor)) as ITextEditor; if (textEditor == null) { return(null); } IEditorUIService uiService = textEditor.GetService(typeof(IEditorUIService)) as IEditorUIService; if (uiService == null) { return(null); } ITextAnchor anchor = textEditor.Document.CreateAnchor(context.InsertionPosition); anchor.MovementType = AnchorMovementType.BeforeInsertion; InsertCtorDialog dialog = new InsertCtorDialog(context, textEditor, anchor); dialog.Element = uiService.CreateInlineUIElement(anchor, dialog); return(dialog); }
InsertCtorDialog CreateDialog(InsertionContext context) { ITextEditor textEditor = context.TextArea.GetService(typeof(ITextEditor)) as ITextEditor; if (textEditor == null) return null; IEditorUIService uiService = textEditor.GetService(typeof(IEditorUIService)) as IEditorUIService; if (uiService == null) return null; ITextAnchor anchor = textEditor.Document.CreateAnchor(context.InsertionPosition); anchor.MovementType = AnchorMovementType.BeforeInsertion; InsertCtorDialog dialog = new InsertCtorDialog(context, textEditor, anchor); dialog.Element = uiService.CreateInlineUIElement(anchor, dialog); return dialog; }