diff options
| author | Shlomo Hecht <shlomo@twine-s.com> | 2019-03-28 10:55:56 +0200 |
|---|---|---|
| committer | Shlomo Hecht <shlomo@twine-s.com> | 2019-03-28 10:55:56 +0200 |
| commit | 36f19301ac0cc27d74b73eb4b31fdecfd86f5060 (patch) | |
| tree | e4f4a636f4a2dc03376e6eff2077ced4079429ed /Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Project.cs | |
| parent | 1ea2a13900697e203658ff8c9489b70866792a49 (diff) | |
| parent | b62c4b8b67b3103c691564df80f65423a9c315a0 (diff) | |
| download | Tango-36f19301ac0cc27d74b73eb4b31fdecfd86f5060.tar.gz Tango-36f19301ac0cc27d74b73eb4b31fdecfd86f5060.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; + } +} |
