From 5ed5ef7ef65731a9e509cb7a707722458da206d1 Mon Sep 17 00:00:00 2001 From: Roy Ben Shabat Date: Wed, 22 Apr 2020 13:28:13 +0300 Subject: Working on FSE scripting. Fixed issue with gradient generation using the color converter RGB only entry point for RGB and LAB brush stops. --- .../Tango.Scripting.Editors/ScriptEditor.cs | 24 ++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) (limited to 'Software/Visual_Studio/Scripting/Tango.Scripting.Editors') diff --git a/Software/Visual_Studio/Scripting/Tango.Scripting.Editors/ScriptEditor.cs b/Software/Visual_Studio/Scripting/Tango.Scripting.Editors/ScriptEditor.cs index 29af14ddc..d1ea9de43 100644 --- a/Software/Visual_Studio/Scripting/Tango.Scripting.Editors/ScriptEditor.cs +++ b/Software/Visual_Studio/Scripting/Tango.Scripting.Editors/ScriptEditor.cs @@ -133,7 +133,7 @@ namespace Tango.Scripting.Editors set { SetValue(ReferenceAssembliesProperty, value); } } public static readonly DependencyProperty ReferenceAssembliesProperty = - DependencyProperty.Register("ReferenceAssemblies", typeof(ObservableCollection), typeof(ScriptEditor), new PropertyMetadata(null)); + DependencyProperty.Register("ReferenceAssemblies", typeof(ObservableCollection), typeof(ScriptEditor), new PropertyMetadata(null, (d, e) => (d as ScriptEditor).OnReferenceAssembliesChanged())); public Object CurrentPopupContent { @@ -1520,7 +1520,7 @@ namespace Tango.Scripting.Editors foreach (var knownType in _knownTypesCache.ToList().Select(x => x.Value).ToList()) { - if (usings.Exists(x => knownType.Type.Namespace == x)) + if (usings.Exists(x => knownType.Type.Namespace == x) && assemblies.Exists(x => x == knownType.Type.Assembly)) { lock (_knownTypes) { @@ -2080,5 +2080,25 @@ namespace Tango.Scripting.Editors } #endregion + + #region Reference Assemblies Changed + + private void OnReferenceAssembliesChanged() + { + if (ReferenceAssemblies != null) + { + ReferenceAssemblies.CollectionChanged -= ReferenceAssemblies_CollectionChanged; + ReferenceAssemblies.CollectionChanged += ReferenceAssemblies_CollectionChanged; + + InvalidateHighlighting(); + } + } + + private void ReferenceAssemblies_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) + { + InvalidateHighlighting(); + } + + #endregion } } -- cgit v1.3.1