diff options
| author | Shlomo Hecht <shlomo@twine-s.com> | 2019-03-19 11:28:08 +0200 |
|---|---|---|
| committer | Shlomo Hecht <shlomo@twine-s.com> | 2019-03-19 11:28:08 +0200 |
| commit | 06358c97b9fc5e20a25a3035dc4c2f0e0ec8a4c1 (patch) | |
| tree | 49ec106ee521b4b6df5cb96993dd1bec676ae2cc /Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Project.cs | |
| parent | 7080d6422a5c20b2acd0562fa2d8b3c91ba1590d (diff) | |
| parent | 270559636c37928e6221384a485901380acd6f28 (diff) | |
| download | Tango-06358c97b9fc5e20a25a3035dc4c2f0e0ec8a4c1.tar.gz Tango-06358c97b9fc5e20a25a3035dc4c2f0e0ec8a4c1.zip | |
Merge branch 'master' of https://twinetfs.visualstudio.com/Tango/_git/Tango
Diffstat (limited to 'Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Project.cs')
| -rw-r--r-- | Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Project.cs | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Project.cs b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Project.cs new file mode 100644 index 000000000..5a950d2c7 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Project.cs @@ -0,0 +1,56 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Media.Imaging; +using Tango.SharedUI.Helpers; + +namespace Tango.Scripting.IDE +{ + public abstract class Project : IProject + { + private static Dictionary<String, BitmapSource> _imageCache; + + static Project() + { + _imageCache = new Dictionary<string, BitmapSource>(); + } + + public string FilePath { get; set; } + + public string WorkingFolder => Path.GetDirectoryName(FilePath); + + public string Name => Path.GetFileNameWithoutExtension(FilePath); + + public abstract BitmapSource Image { get; } + + public ObservableCollection<IProjectItem> Items { get; set; } + + public Project() + { + Items = new ObservableCollection<IProjectItem>(); + } + + public abstract Task Build(); + public abstract Task Run(); + + 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 bool CanOpen => false; + } +} |
