private void OnInsertCodeSnippet(string snippet) { if (string.IsNullOrEmpty(snippet) || selectedWidget == null) { return; } SelectedWidgetCode = _codeSnippetService.Insert(SelectedWidgetCode, snippet, CodeCaretPosition); }