diff options
| author | Roy <roy.mail.net@gmail.com> | 2017-12-08 00:54:27 +0200 |
|---|---|---|
| committer | Roy <roy.mail.net@gmail.com> | 2017-12-08 00:54:27 +0200 |
| commit | db4db5d05b42cbc795b3a38bba3e6c87f30d583f (patch) | |
| tree | 6eb253e1bb8d267ffdf41b2e1ff14febfd4f62a9 /Software/Visual_Studio/Tango.SharedUI/Controls/ScriptEditorControl.xaml.cs | |
| parent | b457125866deb830b379cf3873e5cda3975b077a (diff) | |
| download | Tango-db4db5d05b42cbc795b3a38bba3e6c87f30d583f.tar.gz Tango-db4db5d05b42cbc795b3a38bba3e6c87f30d583f.zip | |
Stubs scripting improvements.
Diffstat (limited to 'Software/Visual_Studio/Tango.SharedUI/Controls/ScriptEditorControl.xaml.cs')
| -rw-r--r-- | Software/Visual_Studio/Tango.SharedUI/Controls/ScriptEditorControl.xaml.cs | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/Software/Visual_Studio/Tango.SharedUI/Controls/ScriptEditorControl.xaml.cs b/Software/Visual_Studio/Tango.SharedUI/Controls/ScriptEditorControl.xaml.cs index d3adf4d78..0551de699 100644 --- a/Software/Visual_Studio/Tango.SharedUI/Controls/ScriptEditorControl.xaml.cs +++ b/Software/Visual_Studio/Tango.SharedUI/Controls/ScriptEditorControl.xaml.cs @@ -78,11 +78,9 @@ namespace Tango.SharedUI.Controls public partial class ScriptEditorControl : UserControl { private CompletionWindow completionWindow; - private bool textChanged; + public ScriptEditorControl() { - HighlightTypes = new ObservableCollection<Type>(); - InitializeComponent(); textEditor.TextArea.IndentationStrategy = new ICSharpCode.AvalonEdit.Indentation.CSharp.CSharpIndentationStrategy(); @@ -120,9 +118,12 @@ namespace Tango.SharedUI.Controls types.Add(new KeyValuePair<string, Type>("String", typeof(String))); types.Add(new KeyValuePair<string, Type>("string", typeof(String))); - foreach (var t in HighlightTypes) + if (HighlightTypes != null) { - types.Add(new KeyValuePair<string, Type>(t.Name, t)); + foreach (var t in HighlightTypes) + { + types.Add(new KeyValuePair<string, Type>(t.Key, t.Value)); + } } var type = types.SingleOrDefault(x => x.Key == keyword); @@ -213,22 +214,21 @@ namespace Tango.SharedUI.Controls private void OnTextChanged() { - if (!textChanged) + if (textEditor.Text != Text) { textEditor.Text = Text; - textChanged = true; } } - public ObservableCollection<Type> HighlightTypes + public ObservableCollection<KeyValuePair<string, Type>> HighlightTypes { - get { return (ObservableCollection<Type>)GetValue(HighlightTypesProperty); } + get { return (ObservableCollection<KeyValuePair<string, Type>>)GetValue(HighlightTypesProperty); } set { SetValue(HighlightTypesProperty, value); } } public static readonly DependencyProperty HighlightTypesProperty = - DependencyProperty.Register("HighlightTypes", typeof(ObservableCollection<Type>), typeof(ScriptEditorControl), new PropertyMetadata(null)); + DependencyProperty.Register("HighlightTypes", typeof(ObservableCollection<KeyValuePair<string, Type>>), typeof(ScriptEditorControl), new PropertyMetadata(null)); |
