aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Scripting/Tango.Scripting.IDE/Controls
diff options
context:
space:
mode:
authorRoy Ben Shabat <Roy.mail.net@gmail.com>2019-04-09 01:47:48 +0300
committerRoy Ben Shabat <Roy.mail.net@gmail.com>2019-04-09 01:47:48 +0300
commit080f1697e97e13461ec6df4d31c8924d01257a1b (patch)
treeb1fe0285de7bc9bc52e9e2195e66fe022bf8f5b3 /Software/Visual_Studio/Scripting/Tango.Scripting.IDE/Controls
parent1608e69a417bc5e40a607c3958c4a60f19f66f1a (diff)
downloadTango-080f1697e97e13461ec6df4d31c8924d01257a1b.tar.gz
Tango-080f1697e97e13461ec6df4d31c8924d01257a1b.zip
MERGE
Diffstat (limited to 'Software/Visual_Studio/Scripting/Tango.Scripting.IDE/Controls')
-rw-r--r--Software/Visual_Studio/Scripting/Tango.Scripting.IDE/Controls/ErrorData.cs54
-rw-r--r--Software/Visual_Studio/Scripting/Tango.Scripting.IDE/Controls/SharedResourceDictionary.cs55
-rw-r--r--Software/Visual_Studio/Scripting/Tango.Scripting.IDE/Controls/SolutionItemControl.cs52
-rw-r--r--Software/Visual_Studio/Scripting/Tango.Scripting.IDE/Controls/TabConrolClose.cs26
4 files changed, 187 insertions, 0 deletions
diff --git a/Software/Visual_Studio/Scripting/Tango.Scripting.IDE/Controls/ErrorData.cs b/Software/Visual_Studio/Scripting/Tango.Scripting.IDE/Controls/ErrorData.cs
new file mode 100644
index 000000000..2dc07ba3f
--- /dev/null
+++ b/Software/Visual_Studio/Scripting/Tango.Scripting.IDE/Controls/ErrorData.cs
@@ -0,0 +1,54 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Tango.Core;
+
+namespace Tango.Scripting.IDE.Controls
+{
+ public class ErrorData: ExtendedObject
+ {
+ private string _severity;
+ private string _error;
+ private string _project;
+ private string _code;
+
+ public string Description
+ {
+ get { return _error; }
+ set
+ {
+ _error = value;
+ RaisePropertyChangedAuto();
+ }
+ }
+ public string Severity
+ {
+ get { return _severity; }
+ set
+ {
+ _severity = value;
+ RaisePropertyChangedAuto();
+ }
+ }
+ public string Project
+ {
+ get { return _project; }
+ set
+ {
+ _project = value;
+ RaisePropertyChangedAuto();
+ }
+ }
+ public string Code
+ {
+ get { return _code; }
+ set { _code = value; }
+ }
+
+ public string File { get; set; }
+ public string Line { get; set; }
+ public string SuppressionState { get; set; }
+ }
+}
diff --git a/Software/Visual_Studio/Scripting/Tango.Scripting.IDE/Controls/SharedResourceDictionary.cs b/Software/Visual_Studio/Scripting/Tango.Scripting.IDE/Controls/SharedResourceDictionary.cs
new file mode 100644
index 000000000..a163355c4
--- /dev/null
+++ b/Software/Visual_Studio/Scripting/Tango.Scripting.IDE/Controls/SharedResourceDictionary.cs
@@ -0,0 +1,55 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Windows;
+
+namespace Tango.Scripting.IDE.Controls
+{
+
+ /// <summary>
+ /// The shared resource dictionary is a specialized resource dictionary
+ /// that loads it content only once. If a second instance with the same source
+ /// is created, it only merges the resources from the cache.
+ /// </summary>
+ public class SharedResourceDictionary : ResourceDictionary
+ {
+ /// <summary>
+ /// Internal cache of loaded dictionaries
+ /// </summary>
+ public static Dictionary<Uri, ResourceDictionary> _sharedDictionaries =
+ new Dictionary<Uri, ResourceDictionary>();
+
+ /// <summary>
+ /// Local member of the source uri
+ /// </summary>
+ private Uri _sourceUri;
+
+ /// <summary>
+ /// Gets or sets the uniform resource identifier (URI) to load resources from.
+ /// </summary>
+ public new Uri Source
+ {
+ get { return _sourceUri; }
+ set
+ {
+ _sourceUri = value;
+
+ if (!_sharedDictionaries.ContainsKey(value))
+ {
+ // If the dictionary is not yet loaded, load it by setting
+ // the source of the base class
+ base.Source = value;
+
+ // add it to the cache
+ _sharedDictionaries.Add(value, this);
+ }
+ else
+ {
+ // If the dictionary is already loaded, get it from the cache
+ MergedDictionaries.Add(_sharedDictionaries[value]);
+ }
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/Software/Visual_Studio/Scripting/Tango.Scripting.IDE/Controls/SolutionItemControl.cs b/Software/Visual_Studio/Scripting/Tango.Scripting.IDE/Controls/SolutionItemControl.cs
new file mode 100644
index 000000000..ad6c65f22
--- /dev/null
+++ b/Software/Visual_Studio/Scripting/Tango.Scripting.IDE/Controls/SolutionItemControl.cs
@@ -0,0 +1,52 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace Tango.Scripting.IDE.Controls
+{
+ public class SolutionItemControl : Control
+ {
+ public ISolutionItem SolutionItem
+ {
+ get { return (ISolutionItem)GetValue(SolutionItemProperty); }
+ set { SetValue(SolutionItemProperty, value); }
+ }
+ public static readonly DependencyProperty SolutionItemProperty =
+ DependencyProperty.Register("SolutionItem", typeof(ISolutionItem), typeof(SolutionItemControl), new PropertyMetadata(null));
+
+ public ICommand OpenCommand
+ {
+ get { return (ICommand)GetValue(OpenCommandProperty); }
+ set { SetValue(OpenCommandProperty, value); }
+ }
+ public static readonly DependencyProperty OpenCommandProperty =
+ DependencyProperty.Register("OpenCommand", typeof(ICommand), typeof(SolutionItemControl), new PropertyMetadata(null));
+
+ static SolutionItemControl()
+ {
+ DefaultStyleKeyProperty.OverrideMetadata(typeof(SolutionItemControl), new FrameworkPropertyMetadata(typeof(SolutionItemControl)));
+ }
+
+ public SolutionItemControl()
+ {
+ PreviewMouseDoubleClick += (_, __) =>
+ {
+ if (SolutionItem.CanOpen)
+ {
+ OpenCommand?.Execute(SolutionItem);
+ }
+ };
+ }
+ }
+}
diff --git a/Software/Visual_Studio/Scripting/Tango.Scripting.IDE/Controls/TabConrolClose.cs b/Software/Visual_Studio/Scripting/Tango.Scripting.IDE/Controls/TabConrolClose.cs
new file mode 100644
index 000000000..7130733e5
--- /dev/null
+++ b/Software/Visual_Studio/Scripting/Tango.Scripting.IDE/Controls/TabConrolClose.cs
@@ -0,0 +1,26 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace Tango.Scripting.IDE.Controls
+{
+
+ public class TabConrolClose : TabControl
+ {
+ static TabConrolClose()
+ {
+ DefaultStyleKeyProperty.OverrideMetadata(typeof(TabConrolClose), new FrameworkPropertyMetadata(typeof(TabConrolClose)));
+ }
+ }
+}