private void AddCode(string code) { ContentEditor.SelectionLength = 0; var formattedCode = code.Replace("\\r", Environment.NewLine) + Environment.NewLine + Environment.NewLine; Clipboard.SetText(formattedCode); ContentEditor.Paste(); this.SaveAndRefreshDiagram(); }