Exemplo n.º 1
0
        private void DoEditScript()
        {
            YamlEditorController.ExpandCodeBlock();
            _selectedBlock = YamlHelper.ExtractBlock(YamlEditorController.SelectedText);
            if (_selectedBlock == null)
            {
                return;
            }

            BlockFormat = "(unchanged)";
            YamlEditorController.SetEnabled("YAML Editor is open", false);
            YamlEditorHeight          = new GridLength(50);
            CodeEditorHeight          = new GridLength(100, GridUnitType.Star);
            CodeEditorController.Text = _selectedBlock.Content;
            CodeEditorController.SetEnabled("Code Editor is open", true);
            Dispatcher.BeginInvoke(DispatcherPriority.Background, () => YamlEditorController.Data.ScrollToLine(YamlEditorController.Data.TextArea.Caret.Line));
        }
 public string ExtractBlock_TestData_Content_Success(string input)
 => YamlHelper.ExtractBlock(input).Content;