diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2019-03-17 18:47:20 +0200 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2019-03-17 18:47:20 +0200 |
| commit | c4b03559eec69b2c69048dc88ed42ea1969b8d52 (patch) | |
| tree | 7c00cdde76773becbc5d1f675b310e8726bfdca4 /Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/ProjectItem.cs | |
| parent | 389b9711ec229f68313bf5da391f05d49bb36434 (diff) | |
| download | Tango-c4b03559eec69b2c69048dc88ed42ea1969b8d52.tar.gz Tango-c4b03559eec69b2c69048dc88ed42ea1969b8d52.zip | |
Fixed issue with Machine Studio Resume.
Worked on Scripting IDE.
Diffstat (limited to 'Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/ProjectItem.cs')
| -rw-r--r-- | Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/ProjectItem.cs | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/ProjectItem.cs b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/ProjectItem.cs new file mode 100644 index 000000000..8adc26dc7 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/ProjectItem.cs @@ -0,0 +1,57 @@ +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 ProjectItem() + { + 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(); + } +} |
