aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Dialogs/BaseProjectDialogVM.cs
diff options
context:
space:
mode:
authorRoy Ben Shabat <Roy.mail.net@gmail.com>2019-04-08 00:45:08 +0300
committerRoy Ben Shabat <Roy.mail.net@gmail.com>2019-04-08 00:45:08 +0300
commit1608e69a417bc5e40a607c3958c4a60f19f66f1a (patch)
treec04d78e2abb5aac8c22350c90cb8b469f6eca30d /Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Dialogs/BaseProjectDialogVM.cs
parent08dd6000fe3a218221003876a699f448835b62e4 (diff)
parentb4a71931ea52636c6b36376aa9d71697ccf73524 (diff)
downloadTango-1608e69a417bc5e40a607c3958c4a60f19f66f1a.tar.gz
Tango-1608e69a417bc5e40a607c3958c4a60f19f66f1a.zip
Merge branch 'master' of https://twinetfs.visualstudio.com/Tango/_git/Tango
Diffstat (limited to 'Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Dialogs/BaseProjectDialogVM.cs')
-rw-r--r--Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Dialogs/BaseProjectDialogVM.cs96
1 files changed, 96 insertions, 0 deletions
diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Dialogs/BaseProjectDialogVM.cs b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Dialogs/BaseProjectDialogVM.cs
new file mode 100644
index 000000000..5f2ebcb15
--- /dev/null
+++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Dialogs/BaseProjectDialogVM.cs
@@ -0,0 +1,96 @@
+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.Core.Commands;
+using Tango.Scripting.IDE.ProjectTypes;
+using Tango.SharedUI;
+
+namespace Tango.Scripting.IDE.Dialogs
+{
+ public class BaseProjectDialogVM : IDEDialogViewModel
+ {
+ #region properties
+ public ObservableCollection<IProjectType> ProjectTypes { get; set; }
+
+ private IProjectType _selectedProjectType = null;
+ public IProjectType SelectedProjectType
+ {
+ get { return _selectedProjectType; }
+ set
+ {
+ _selectedProjectType = value;
+ RaisePropertyChangedAuto();
+ RaisePropertyChanged("LargeImage");
+ RaisePropertyChanged("SelectedDescription");
+ }
+ }
+ private BitmapSource _defaultLargeImage = ProjectType.GetImage("Images/test.png");
+ public BitmapSource LargeImage
+ {
+ get
+ {
+ if (SelectedProjectType != null)
+ return SelectedProjectType.LargeImage;
+ else return _defaultLargeImage;
+ }
+ }
+ public string SelectedDescription
+ {
+ get
+ {
+ if (SelectedProjectType != null)
+ return SelectedProjectType.Description;
+ return "";
+ }
+ }
+ private String _projectName = "App1";
+ public String ProjectName
+ {
+ get { return _projectName; }
+ set { _projectName = value; RaisePropertyChangedAuto(); }
+ }
+ private String _projectLocation;
+ public String ProjectLocation
+ {
+ get { return _projectLocation; }
+ set { _projectLocation = value; RaisePropertyChangedAuto(); }
+ }
+ #endregion
+ #region constructor
+ public BaseProjectDialogVM() : base()
+ {
+ ProjectTypes = new ObservableCollection<IProjectType>();
+ RegisterProjectType(new StubProjectType());
+ RegisterProjectType(new UnitTestProjectType());
+
+ _selectedProjectType = ProjectTypes.FirstOrDefault();
+
+ string workingDirectory = Environment.CurrentDirectory;
+ ProjectLocation = Directory.GetParent(workingDirectory).Parent.Parent.FullName;
+
+ CanClose = true;
+ CloseCommand = new RelayCommand(Cancel, (x) => CanClose);
+ OKCommand = new RelayCommand(Accept, (x) => CanClose);
+ }
+ #endregion
+ #region commands
+
+ #endregion
+ #region register_project_types
+ public void RegisterProjectType(IProjectType projectType)
+ {
+ ProjectTypes.Add(projectType);
+ }
+
+ public void UnRegisterProjectItemHandler(IProjectType projectType)
+ {
+ ProjectTypes.Remove(projectType);
+ }
+ #endregion
+ }
+}