private void DoApplyEdit() { string s; switch (BlockFormat) { case "(unchanged)": s = YamlHelper.FormatBlock(CodeEditorController.Text, _selectedBlock.Suffix, _selectedBlock.Indent, ScalarType.None); break; case "Block": s = YamlHelper.FormatBlock(CodeEditorController.Text, _selectedBlock.Suffix, _selectedBlock.Indent, ScalarType.BlockFoldedStrip); break; case "Split": s = YamlHelper.FormatBlock(CodeEditorController.Text, _selectedBlock.Suffix, _selectedBlock.Indent, ScalarType.Plain); break; default: return; } YamlEditorController.SelectedText = s; CodeEditorController.Text = ""; CloseCodeEditor(); ApplicationDispatcher.Instance.BeginInvoke(DispatcherPriority.Render, YamlEditorController.BringSelectionIntoView); }
public string FormatBlock_TestData_Success(string input, string suffix, ScalarType scalarType) => YamlHelper.FormatBlock(input, suffix, 2, scalarType);