public async void Diagram(string word) { if (Model.Document == null) { return; } var fileId = Model.Document.Id; await Diagram(word, fileId, blocks => { var diagramDialog = new DiagramDialog(); diagramDialog.AddBlocks(blocks.ToArray()); diagramDialog.ShowDialog(); }); }
public async void Diagram(Scintilla editor = null) { if (editor == null) { editor = Model.Document?.Editor; } if (editor == null) { return; } var word = editor.GetCurrentWord(); var inlineEdit = editor.GetData <InlineEditData>(0).FirstOrDefault(); var fileId = inlineEdit?.Location.FileId ?? Model.Document.Id; await Diagram(word, fileId, blocks => { var diagramDialog = new DiagramDialog(); diagramDialog.AddBlocks(blocks.ToArray()); diagramDialog.ShowDialog(); }); }