aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Scripting/Tango.Scripting.IDE/ProjectItem.cs
diff options
context:
space:
mode:
authorShlomo Hecht <shlomo@twine-s.com>2019-05-05 10:31:06 +0300
committerShlomo Hecht <shlomo@twine-s.com>2019-05-05 10:31:06 +0300
commit79bd7bb6a22f1da1a77fcc3f527a0955028f2447 (patch)
tree3e1c30dbbf7b6ccf70aa5631ad2f42ee356b4e25 /Software/Visual_Studio/Scripting/Tango.Scripting.IDE/ProjectItem.cs
parent4129b6caa72f8bafeeefe1a4a88a0d5e1568e245 (diff)
parent661c55343a468a9c150e8d163711567f89a02889 (diff)
downloadTango-79bd7bb6a22f1da1a77fcc3f527a0955028f2447.tar.gz
Tango-79bd7bb6a22f1da1a77fcc3f527a0955028f2447.zip
merge tpf
Diffstat (limited to 'Software/Visual_Studio/Scripting/Tango.Scripting.IDE/ProjectItem.cs')
-rw-r--r--Software/Visual_Studio/Scripting/Tango.Scripting.IDE/ProjectItem.cs58
1 files changed, 58 insertions, 0 deletions
diff --git a/Software/Visual_Studio/Scripting/Tango.Scripting.IDE/ProjectItem.cs b/Software/Visual_Studio/Scripting/Tango.Scripting.IDE/ProjectItem.cs
new file mode 100644
index 000000000..d7fbd8e92
--- /dev/null
+++ b/Software/Visual_Studio/Scripting/Tango.Scripting.IDE/ProjectItem.cs
@@ -0,0 +1,58 @@
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Media.Imaging;
+using Tango.Core;
+using Tango.SharedUI.Helpers;
+
+namespace Tango.Scripting.IDE
+{
+ public abstract class ProjectItem : ExtendedObject, IProjectItem
+ {
+ private static Dictionary<String, BitmapSource> _imageCache;
+
+ static ProjectItem()
+ {
+ _imageCache = new Dictionary<string, BitmapSource>();
+ }
+
+ public string Name { get; set; }
+ public ObservableCollection<IProjectItem> Items { get; set; }
+ public ObservableCollection<ISolutionItemCommand> Commands { get ; set; }
+
+ public ProjectItem():base()
+ {
+ Items = new ObservableCollection<IProjectItem>();
+ }
+
+ public abstract BitmapSource Image { get; }
+
+ public abstract FrameworkElement OnGetView();
+
+ private FrameworkElement GetView()
+ {
+ return OnGetView();
+ }
+
+ protected static BitmapSource GetImage(String name)
+ {
+ if (_imageCache.ContainsKey(name))
+ {
+ return _imageCache[name];
+ }
+ else
+ {
+ var image = ResourceHelper.GetImageFromResources(name);
+ _imageCache.Add(name, image);
+ return image;
+ }
+ }
+
+ public abstract bool CanOpen { get; }
+ public FrameworkElement View => GetView();
+ }
+}