void editWindowItem_Click(object sender, RoutedEventArgs e) { if (!initWindow) { editWindow = new dynScriptEditWindow(); // callbacks for autocompletion editWindow.editText.TextArea.TextEntering += textEditor_TextArea_TextEntering; editWindow.editText.TextArea.TextEntered += textEditor_TextArea_TextEntered; const string pythonHighlighting = "ICSharpCode.PythonBinding.Resources.Python.xshd"; var elem = GetType().Assembly.GetManifestResourceStream("DynamoPython.Resources." + pythonHighlighting); editWindow.editText.SyntaxHighlighting = HighlightingLoader.Load(new XmlTextReader(elem), HighlightingManager.Instance); } //set the text of the edit window to begin editWindow.editText.Text = script; if (editWindow.ShowDialog() != true) { return; } //set the value from the text in the box script = editWindow.editText.Text; this.dirty = true; }
void editWindowItem_Click(object sender, RoutedEventArgs e) { _editWindow = new dynScriptEditWindow(); // callbacks for autocompletion _editWindow.editText.TextArea.TextEntering += textEditor_TextArea_TextEntering; _editWindow.editText.TextArea.TextEntered += textEditor_TextArea_TextEntered; const string pythonHighlighting = "ICSharpCode.PythonBinding.Resources.Python.xshd"; var elem = GetType() .Assembly.GetManifestResourceStream( "DynamoPython.Resources." + pythonHighlighting); _editWindow.editText.SyntaxHighlighting = HighlightingLoader.Load( new XmlTextReader(elem), HighlightingManager.Instance); //set the text of the edit window to begin _editWindow.editText.Text = _script; if (_editWindow.ShowDialog() != true) { return; } //set the value from the text in the box Script = _editWindow.editText.Text; }