diff options
| author | Mirta <mirta@twine-s.com> | 2019-05-12 13:34:12 +0300 |
|---|---|---|
| committer | Mirta <mirta@twine-s.com> | 2019-05-12 13:34:12 +0300 |
| commit | 843774b4d84769783cf0100ad5a91ce3871c83b1 (patch) | |
| tree | 3323ea585fd8475d3720bb4912b62c86c4a7b0f9 /Software/Visual_Studio/Scripting/Tango.Scripting.IDE/ScriptIDEViewVM.cs | |
| parent | 3043e65ad539455ad2510e402e1c8f2d168577d2 (diff) | |
| parent | 524bc43f07339979eda1c812354a9a2e8e0f7e09 (diff) | |
| download | Tango-843774b4d84769783cf0100ad5a91ce3871c83b1.tar.gz Tango-843774b4d84769783cf0100ad5a91ce3871c83b1.zip | |
MERGE
Diffstat (limited to 'Software/Visual_Studio/Scripting/Tango.Scripting.IDE/ScriptIDEViewVM.cs')
| -rw-r--r-- | Software/Visual_Studio/Scripting/Tango.Scripting.IDE/ScriptIDEViewVM.cs | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/Software/Visual_Studio/Scripting/Tango.Scripting.IDE/ScriptIDEViewVM.cs b/Software/Visual_Studio/Scripting/Tango.Scripting.IDE/ScriptIDEViewVM.cs index facebe061..d41de8cd1 100644 --- a/Software/Visual_Studio/Scripting/Tango.Scripting.IDE/ScriptIDEViewVM.cs +++ b/Software/Visual_Studio/Scripting/Tango.Scripting.IDE/ScriptIDEViewVM.cs @@ -29,7 +29,16 @@ namespace Tango.Scripting.IDE public Solution Solution { get { return _solution; } - set { _solution = value; RaisePropertyChangedAuto(); } + set { + if (_solution != value) + { + if(_solution != null) + _solution.AddProjectEvent -= delegate { AddProject(); }; + _solution = value; + _solution.AddProjectEvent += delegate { AddProject(); }; + RaisePropertyChangedAuto(); + } + } } private IProject _selectedProject; @@ -89,6 +98,7 @@ namespace Tango.Scripting.IDE RegisterProjectType(new UnitTestProjectType()); Solution = new Solution(); + Solution.Name = "Test Solution"; Solution.SolutionLocation = @"C:\Test"; Solution.Projects.Add(_projectTypes.First().NewProject("Test Project.stub")); @@ -147,7 +157,7 @@ namespace Tango.Scripting.IDE /// </summary> private async void AddNewProject() { - var vm = await NotificationManager.ShowDialog<NewProjectViewVM>(new NewProjectViewVM(Settings.LastSolutionLocations)); + var vm = await NotificationManager.ShowDialog<NewProjectViewVM>(new NewProjectViewVM(Settings.LastSolutionLocations, _projectTypes)); if (vm.DialogResult) { @@ -155,9 +165,8 @@ namespace Tango.Scripting.IDE newSolution.Name = vm.SolutionName; newSolution.SolutionLocation = vm.ProjectLocation; Solution = newSolution; - StringBuilder builder = new StringBuilder(vm.ProjectLocation); - builder.AppendFormat(@"\{0}", vm.ProjectName); - Solution.Projects.Add(vm.SelectedProjectType.NewProject(builder.ToString())); + + Solution.Projects.Add(vm.SelectedProjectType.NewProject(vm.GetFullProjectPath())); Settings.LastSolutionLocations.Insert(0, vm.ProjectLocation); Settings.Save(); @@ -165,18 +174,14 @@ namespace Tango.Scripting.IDE } private async void AddProject() { - var vm = await NotificationManager.ShowDialog<AddProjectViewVM>(new AddProjectViewVM() + var vm = await NotificationManager.ShowDialog<AddProjectViewVM>(new AddProjectViewVM(_projectTypes) { ProjectLocation = Solution.SolutionLocation - //ProjectLocation = Path.GetDirectoryName(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase)) - //ProjectLocation = "Current Solution folder..." }); if (vm.DialogResult) { - StringBuilder builder = new StringBuilder(vm.ProjectLocation); - builder.AppendFormat(@"\{0}", vm.ProjectName); - Solution.Projects.Add(vm.SelectedProjectType.NewProject(builder.ToString())); + Solution.Projects.Add(vm.SelectedProjectType.NewProject(vm.GetFullProjectPath())); } } public bool IsSolutionProject(IProject SelectedItem) |
