diff options
Diffstat (limited to 'Software/Visual_Studio/VSIX/Tango.BuildExtensions/TangoBuildCommand.cs')
| -rw-r--r-- | Software/Visual_Studio/VSIX/Tango.BuildExtensions/TangoBuildCommand.cs | 61 |
1 files changed, 60 insertions, 1 deletions
diff --git a/Software/Visual_Studio/VSIX/Tango.BuildExtensions/TangoBuildCommand.cs b/Software/Visual_Studio/VSIX/Tango.BuildExtensions/TangoBuildCommand.cs index 624124ef2..407530570 100644 --- a/Software/Visual_Studio/VSIX/Tango.BuildExtensions/TangoBuildCommand.cs +++ b/Software/Visual_Studio/VSIX/Tango.BuildExtensions/TangoBuildCommand.cs @@ -38,6 +38,7 @@ namespace Tango.BuildExtensions private const String edmxModelName = "RemoteADO.edmx"; private const String observablesGeneratorProjectName = "Tango.DBObservablesGenerator.CLI"; private const String observablesProjectName = "Tango.BL"; + private const String observablesContextName = "ObservablesContext.cs"; private const String pmrGeneratorProjectName = "Tango.PMRGenerator.CLI"; private const String pmrProjectName = "Tango.PMR"; private const String protoCliProjectName = "Tango.Protobuf.CLI"; @@ -146,8 +147,12 @@ namespace Tango.BuildExtensions OpenVSProgress("Tango Build Engine", "Initializing...", true); + String current_startup_project = DTE.Solution.Properties.Item("StartupProject").Value.ToString(); + try { + + if (buildForm.UpdateDataBaseEntities) { UpdateDatabaseEntities(); @@ -179,9 +184,13 @@ namespace Tango.BuildExtensions } catch (Exception ex) { - CloseVSProgress(); ShowMessage(ex.Message); } + finally + { + CloseVSProgress(); + DTE.Solution.Properties.Item("StartupProject").Value = current_startup_project; + } }); } @@ -344,6 +353,56 @@ namespace Tango.BuildExtensions { throw new ExternalException(observablesProjectName + " failed to build!"); } + + project = _projects.SingleOrDefault(x => x.Name == observablesProjectName); + + if (project == null) + { + throw new NullReferenceException("Could not locate project " + observablesProjectName); + } + + SetVSProgress("Generating views for ObservablesContext..."); + var views_file = GetProjectItems(project).SingleOrDefault(x => x.Name == observablesContextName); + + if (views_file == null) + { + throw new NullReferenceException("Could not locate " + observablesContextName + "!"); + } + + Wait(1000); + + DTE.MainWindow.Activate(); + + ExpandSolutionExplorerNode($"Tango\\{observablesProjectName}"); + Wait(1000); + + SelectSolutionExplorerNode($"Tango\\{observablesProjectName}\\{observablesContextName}"); + Wait(1000); + + Keyboard.Instance.HoldKey(KeyboardInput.SpecialKeys.SHIFT); + Keyboard.Instance.PressSpecialKey(KeyboardInput.SpecialKeys.F10); + Keyboard.Instance.LeaveAllKeys(); + + Wait(1000); + + for (int i = 0; i < 3; i++) + { + Keyboard.Instance.PressSpecialKey(KeyboardInput.SpecialKeys.DOWN); + Wait(100); + } + + Keyboard.Instance.PressSpecialKey(KeyboardInput.SpecialKeys.RIGHT); + Wait(100); + + for (int i = 0; i < 3; i++) + { + Keyboard.Instance.PressSpecialKey(KeyboardInput.SpecialKeys.DOWN); + Wait(100); + } + + Keyboard.Instance.PressSpecialKey(KeyboardInput.SpecialKeys.RETURN); + + _window.WaitWhileBusy(); } private void GenerateAutoPMRMessages() |
