示例#1
0
        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();
            });
        }
示例#2
0
        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();
            });
        }