private void _timer_Tick(object sender, EventArgs e) { string _text = Clipboard.GetText(); if (string.IsNullOrWhiteSpace(_text)) { return; } if (_prevClipboard.Equals(_text)) { return; } CodeSnippet _currentSnippet = _treeviewHelper.FromNode(_treeviewHelper.SelectedNode); if (_currentSnippet.Name == Constants.CLIPBOARDMONITOR && _currentSnippet.CodeType == CodeType.System) { _textBoxHelper.Text = _textBoxHelper.Text + _text + "\r\n"; } else { CodeSnippet _clipboardSnippet = CodeLib.Instance.ClipboardMonitor; _clipboardSnippet.SetCode(_clipboardSnippet.GetCode() + _text + "\r\n", out bool _changed); } _prevClipboard = _text; }
private void EditNodeProperties(bool keepFocus = false) { if (_treeHelper.IsSystem(treeViewLibrary.SelectedNode) || treeViewLibrary.SelectedNode == null) { return; } CodeSnippet _snippet = _treeHelper.FromNode(treeViewLibrary.SelectedNode); FormProperties _form = new FormProperties(_themeHelper) { Snippet = _snippet }; _form.ShowDialog(this); CodeLib.Instance.Refresh(); _treeHelper.RefreshCurrentTreeNode(); if (keepFocus) { // } else { fastColoredTextBox.Focus(); } }