/// <summary> /// Instruct the handler to insert data into the presentation editor /// </summary> protected override bool DoInsertData(DataAction action, MarkupPointer begin, MarkupPointer end) { string imagePath = SaveImageDataToTempFile(DataMeister.ImageData); if (imagePath != null) { //hack: drive the selection textRange to the caret (before calling InsertImages) EditorContext.MarkupServices.CreateMarkupRange(begin, end).ToTextRange().select(); _blogEditor.InsertImages(new string[] { imagePath }, ImageInsertEntryPoint.DragDrop); return(true); } return(false); }
protected bool DoInsertDataCore(List <string> files, DataAction action, MarkupPointer begin, MarkupPointer end) { IHtmlEditorHost blogEditor = _blogEditor; ImageInsertEntryPoint imageInsertEntryPoint = ImageInsertEntryPoint; EditorContext.Invoke(delegate { //hack: drive the selection textRange to the caret (before calling InsertImages) EditorContext.MarkupServices.CreateMarkupRange(begin, end).ToTextRange().select(); string[] fileArray = files.ToArray(); blogEditor.InsertImages(fileArray, ImageInsertEntryPoint.DragDrop); }); return(true); }