diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2019-01-17 13:32:58 +0200 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2019-01-17 13:32:58 +0200 |
| commit | 071dc67e905d23347ac6b5cc4573972d91dd0ea3 (patch) | |
| tree | 0410bf19ca3224767acb8a03e485808c04e5c360 /Software/Visual_Studio/VSIX/Tango.BuildExtensions | |
| parent | 92c52918e13dbbaf2a658945c349a6d04c29aa81 (diff) | |
| download | Tango-071dc67e905d23347ac6b5cc4573972d91dd0ea3.tar.gz Tango-071dc67e905d23347ac6b5cc4573972d91dd0ea3.zip | |
Upgraded EF from 6.0 to 6.2 for all projects.
Improved EF first load with pre-compiled views and model store.
Implemented auto generate views in Tango Build VSIX.
Diffstat (limited to 'Software/Visual_Studio/VSIX/Tango.BuildExtensions')
3 files changed, 101 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() diff --git a/Software/Visual_Studio/VSIX/Tango.BuildExtensions/VSIXBase.cs b/Software/Visual_Studio/VSIX/Tango.BuildExtensions/VSIXBase.cs index 3957bbfdf..349962280 100644 --- a/Software/Visual_Studio/VSIX/Tango.BuildExtensions/VSIXBase.cs +++ b/Software/Visual_Studio/VSIX/Tango.BuildExtensions/VSIXBase.cs @@ -127,6 +127,43 @@ namespace Tango.BuildExtensions return assemblyPath; } + protected void SelectSolutionExplorerNode(string nodePath) + { + EnvDTE.UIHierarchyItem item; + + try + { + item = DTE.ToolWindows.SolutionExplorer.GetItem(nodePath); + item.Select(vsUISelectionType.vsUISelectionTypeSelect); + } + catch (Exception ex) + { + System.Windows.Forms.MessageBox.Show(ex.ToString()); + } + } + + protected void ExpandSolutionExplorerNode(string nodePath) + { + EnvDTE.UIHierarchyItem item; + + try + { + var explorer = DTE.ToolWindows.SolutionExplorer; + + item = explorer.GetItem(nodePath); + item.Select(vsUISelectionType.vsUISelectionTypeSelect); + + if (!item.UIHierarchyItems.Expanded) + { + explorer.DoDefaultAction(); + } + } + catch (Exception ex) + { + System.Windows.Forms.MessageBox.Show(ex.ToString()); + } + } + #endregion #region Notifications diff --git a/Software/Visual_Studio/VSIX/Tango.BuildExtensions/app.config b/Software/Visual_Studio/VSIX/Tango.BuildExtensions/app.config index cacd4cd77..49b6f5ebe 100644 --- a/Software/Visual_Studio/VSIX/Tango.BuildExtensions/app.config +++ b/Software/Visual_Studio/VSIX/Tango.BuildExtensions/app.config @@ -6,6 +6,10 @@ <assemblyIdentity name="System.Reactive.Core" publicKeyToken="94bc3704cddfc263" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-3.0.3000.0" newVersion="3.0.3000.0" /> </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" /> + </dependentAssembly> </assemblyBinding> </runtime> </configuration>
\ No newline at end of file |
