diff options
| author | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2018-06-23 20:57:43 +0300 |
|---|---|---|
| committer | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2018-06-23 20:57:43 +0300 |
| commit | 55c624cfa11e1c7998e5d3de0721aeee0814ce33 (patch) | |
| tree | adaad581c820aee174d559b6bae1075a78ea793b /Software/Visual_Studio/VSIX/Tango.BuildExtensions | |
| parent | 9488c1e116ffb61beb7bd581695605a75b2b7de9 (diff) | |
| download | Tango-55c624cfa11e1c7998e5d3de0721aeee0814ce33.tar.gz Tango-55c624cfa11e1c7998e5d3de0721aeee0814ce33.zip | |
Implemented TouchAutoComplete!
Refactored VSIX Tango Build Engine to use VS dialogs only.
Added SQLite generation to VSIX.
Implemented Job customer with auto complete on PPC job view.
Diffstat (limited to 'Software/Visual_Studio/VSIX/Tango.BuildExtensions')
8 files changed, 81 insertions, 374 deletions
diff --git a/Software/Visual_Studio/VSIX/Tango.BuildExtensions/BuildForm.Designer.cs b/Software/Visual_Studio/VSIX/Tango.BuildExtensions/BuildForm.Designer.cs index 5f7c82c65..da3796faf 100644 --- a/Software/Visual_Studio/VSIX/Tango.BuildExtensions/BuildForm.Designer.cs +++ b/Software/Visual_Studio/VSIX/Tango.BuildExtensions/BuildForm.Designer.cs @@ -39,6 +39,7 @@ this.pictureBox1 = new System.Windows.Forms.PictureBox(); this.label2 = new System.Windows.Forms.Label(); this.label1 = new System.Windows.Forms.Label(); + this.chkSQLite = new System.Windows.Forms.CheckBox(); this.panel1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); this.SuspendLayout(); @@ -46,6 +47,7 @@ // panel1 // this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.panel1.Controls.Add(this.chkSQLite); this.panel1.Controls.Add(this.btnCancel); this.panel1.Controls.Add(this.btnOK); this.panel1.Controls.Add(this.chkBuildSolution); @@ -59,7 +61,7 @@ this.panel1.Dock = System.Windows.Forms.DockStyle.Fill; this.panel1.Location = new System.Drawing.Point(0, 0); this.panel1.Name = "panel1"; - this.panel1.Size = new System.Drawing.Size(596, 285); + this.panel1.Size = new System.Drawing.Size(596, 327); this.panel1.TabIndex = 2; // // btnCancel @@ -71,7 +73,7 @@ this.btnCancel.FlatAppearance.MouseDownBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(15)))), ((int)(((byte)(15)))), ((int)(((byte)(15))))); this.btnCancel.FlatAppearance.MouseOverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(60)))), ((int)(((byte)(60))))); this.btnCancel.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.btnCancel.Location = new System.Drawing.Point(349, 230); + this.btnCancel.Location = new System.Drawing.Point(349, 272); this.btnCancel.Name = "btnCancel"; this.btnCancel.Size = new System.Drawing.Size(114, 42); this.btnCancel.TabIndex = 11; @@ -87,7 +89,7 @@ this.btnOK.FlatAppearance.MouseDownBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(15)))), ((int)(((byte)(15)))), ((int)(((byte)(15))))); this.btnOK.FlatAppearance.MouseOverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(60)))), ((int)(((byte)(60))))); this.btnOK.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.btnOK.Location = new System.Drawing.Point(469, 230); + this.btnOK.Location = new System.Drawing.Point(469, 272); this.btnOK.Name = "btnOK"; this.btnOK.Size = new System.Drawing.Size(114, 42); this.btnOK.TabIndex = 10; @@ -99,11 +101,11 @@ this.chkBuildSolution.AutoSize = true; this.chkBuildSolution.Cursor = System.Windows.Forms.Cursors.Arrow; this.chkBuildSolution.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.chkBuildSolution.Location = new System.Drawing.Point(27, 196); + this.chkBuildSolution.Location = new System.Drawing.Point(27, 222); this.chkBuildSolution.Name = "chkBuildSolution"; - this.chkBuildSolution.Size = new System.Drawing.Size(108, 20); + this.chkBuildSolution.Size = new System.Drawing.Size(111, 20); this.chkBuildSolution.TabIndex = 9; - this.chkBuildSolution.Text = "Build Solution"; + this.chkBuildSolution.Text = "Build Solution."; this.chkBuildSolution.UseVisualStyleBackColor = true; // // chkUpdateAndBuildPMR @@ -190,12 +192,24 @@ this.label1.Text = "Tango Build Engine"; this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // + // chkSQLite + // + this.chkSQLite.AutoSize = true; + this.chkSQLite.Cursor = System.Windows.Forms.Cursors.Arrow; + this.chkSQLite.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.chkSQLite.Location = new System.Drawing.Point(27, 196); + this.chkSQLite.Name = "chkSQLite"; + this.chkSQLite.Size = new System.Drawing.Size(252, 20); + this.chkSQLite.TabIndex = 12; + this.chkSQLite.Text = "Generate SQLite DB from SQL Server."; + this.chkSQLite.UseVisualStyleBackColor = true; + // // BuildForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20))))); - this.ClientSize = new System.Drawing.Size(596, 285); + this.ClientSize = new System.Drawing.Size(596, 327); this.ControlBox = false; this.Controls.Add(this.panel1); this.ForeColor = System.Drawing.Color.Gainsboro; @@ -228,5 +242,6 @@ private System.Windows.Forms.CheckBox chkBuildSolution; private System.Windows.Forms.Button btnOK; private System.Windows.Forms.Button btnCancel; + private System.Windows.Forms.CheckBox chkSQLite; } }
\ No newline at end of file diff --git a/Software/Visual_Studio/VSIX/Tango.BuildExtensions/BuildForm.cs b/Software/Visual_Studio/VSIX/Tango.BuildExtensions/BuildForm.cs index ff75ec321..86ad94a13 100644 --- a/Software/Visual_Studio/VSIX/Tango.BuildExtensions/BuildForm.cs +++ b/Software/Visual_Studio/VSIX/Tango.BuildExtensions/BuildForm.cs @@ -16,6 +16,7 @@ namespace Tango.BuildExtensions public bool GenerateAndBuildObservables { get; set; } public bool GenerateAutoPmrMessages { get; set; } public bool UpdateAndBuildPmrMessages { get; set; } + public bool GenerateSQLite { get; set; } public bool BuildSolution { get; set; } public BuildForm() @@ -40,6 +41,7 @@ namespace Tango.BuildExtensions GenerateAndBuildObservables = chkGenerateObservables.Checked; GenerateAutoPmrMessages = chkGeneratePMR.Checked; UpdateAndBuildPmrMessages = chkUpdateAndBuildPMR.Checked; + GenerateSQLite = chkSQLite.Checked; BuildSolution = chkBuildSolution.Checked; Close(); diff --git a/Software/Visual_Studio/VSIX/Tango.BuildExtensions/ProgressForm.Designer.cs b/Software/Visual_Studio/VSIX/Tango.BuildExtensions/ProgressForm.Designer.cs deleted file mode 100644 index 7b9493b08..000000000 --- a/Software/Visual_Studio/VSIX/Tango.BuildExtensions/ProgressForm.Designer.cs +++ /dev/null @@ -1,138 +0,0 @@ -namespace Tango.BuildExtensions -{ - partial class SelectForm - { - /// <summary> - /// Required designer variable. - /// </summary> - private System.ComponentModel.IContainer components = null; - - /// <summary> - /// Clean up any resources being used. - /// </summary> - /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// <summary> - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// </summary> - private void InitializeComponent() - { - this.label1 = new System.Windows.Forms.Label(); - this.panel1 = new System.Windows.Forms.Panel(); - this.pictureBox1 = new System.Windows.Forms.PictureBox(); - this.lbSTatus = new System.Windows.Forms.Label(); - this.progressBar1 = new System.Windows.Forms.ProgressBar(); - this.panel1.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); - this.SuspendLayout(); - // - // label1 - // - this.label1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(40)))), ((int)(((byte)(40)))), ((int)(((byte)(40))))); - this.label1.Dock = System.Windows.Forms.DockStyle.Top; - this.label1.Location = new System.Drawing.Point(0, 0); - this.label1.Margin = new System.Windows.Forms.Padding(0); - this.label1.Name = "label1"; - this.label1.Padding = new System.Windows.Forms.Padding(5, 0, 0, 0); - this.label1.Size = new System.Drawing.Size(483, 29); - this.label1.TabIndex = 0; - this.label1.Text = "Tango Build Extensions"; - this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - this.label1.UseWaitCursor = true; - // - // panel1 - // - this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.panel1.Controls.Add(this.pictureBox1); - this.panel1.Controls.Add(this.lbSTatus); - this.panel1.Controls.Add(this.progressBar1); - this.panel1.Controls.Add(this.label1); - this.panel1.Dock = System.Windows.Forms.DockStyle.Fill; - this.panel1.Location = new System.Drawing.Point(0, 0); - this.panel1.Name = "panel1"; - this.panel1.Size = new System.Drawing.Size(485, 156); - this.panel1.TabIndex = 1; - this.panel1.UseWaitCursor = true; - // - // pictureBox1 - // - this.pictureBox1.Image = global::Tango.BuildExtensions.Properties.Resources.machine_trans_small; - this.pictureBox1.Location = new System.Drawing.Point(12, 40); - this.pictureBox1.Name = "pictureBox1"; - this.pictureBox1.Size = new System.Drawing.Size(63, 68); - this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; - this.pictureBox1.TabIndex = 3; - this.pictureBox1.TabStop = false; - this.pictureBox1.UseWaitCursor = true; - // - // lbSTatus - // - this.lbSTatus.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.lbSTatus.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lbSTatus.Location = new System.Drawing.Point(41, 56); - this.lbSTatus.Name = "lbSTatus"; - this.lbSTatus.Size = new System.Drawing.Size(404, 44); - this.lbSTatus.TabIndex = 2; - this.lbSTatus.Text = "Initializing..."; - this.lbSTatus.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - this.lbSTatus.UseWaitCursor = true; - // - // progressBar1 - // - this.progressBar1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.progressBar1.Location = new System.Drawing.Point(11, 120); - this.progressBar1.Name = "progressBar1"; - this.progressBar1.Size = new System.Drawing.Size(461, 23); - this.progressBar1.Style = System.Windows.Forms.ProgressBarStyle.Marquee; - this.progressBar1.TabIndex = 1; - this.progressBar1.UseWaitCursor = true; - this.progressBar1.Value = 50; - // - // SelectForm - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20))))); - this.ClientSize = new System.Drawing.Size(485, 156); - this.ControlBox = false; - this.Controls.Add(this.panel1); - this.ForeColor = System.Drawing.Color.Gainsboro; - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "SelectForm"; - this.ShowIcon = false; - this.ShowInTaskbar = false; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; - this.Text = "Tango Initializer"; - this.TopMost = true; - this.UseWaitCursor = true; - this.panel1.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); - this.ResumeLayout(false); - - } - - #endregion - - private System.Windows.Forms.Label label1; - private System.Windows.Forms.Panel panel1; - private System.Windows.Forms.ProgressBar progressBar1; - private System.Windows.Forms.Label lbSTatus; - private System.Windows.Forms.PictureBox pictureBox1; - } -}
\ No newline at end of file diff --git a/Software/Visual_Studio/VSIX/Tango.BuildExtensions/ProgressForm.cs b/Software/Visual_Studio/VSIX/Tango.BuildExtensions/ProgressForm.cs deleted file mode 100644 index 349721155..000000000 --- a/Software/Visual_Studio/VSIX/Tango.BuildExtensions/ProgressForm.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; - -namespace Tango.BuildExtensions -{ - public partial class SelectForm : Form - { - public SelectForm() - { - InitializeComponent(); - } - - public void SetStatus(String text) - { - lbSTatus.Text = text; - } - - protected override bool ShowWithoutActivation - { - get - { - return true; - } - } - } -} diff --git a/Software/Visual_Studio/VSIX/Tango.BuildExtensions/ProgressForm.resx b/Software/Visual_Studio/VSIX/Tango.BuildExtensions/ProgressForm.resx deleted file mode 100644 index 1af7de150..000000000 --- a/Software/Visual_Studio/VSIX/Tango.BuildExtensions/ProgressForm.resx +++ /dev/null @@ -1,120 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<root> - <!-- - Microsoft ResX Schema - - Version 2.0 - - The primary goals of this format is to allow a simple XML format - that is mostly human readable. The generation and parsing of the - various data types are done through the TypeConverter classes - associated with the data types. - - Example: - - ... ado.net/XML headers & schema ... - <resheader name="resmimetype">text/microsoft-resx</resheader> - <resheader name="version">2.0</resheader> - <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> - <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> - <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> - <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> - <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> - <value>[base64 mime encoded serialized .NET Framework object]</value> - </data> - <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> - <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> - <comment>This is a comment</comment> - </data> - - There are any number of "resheader" rows that contain simple - name/value pairs. - - Each data row contains a name, and value. The row also contains a - type or mimetype. Type corresponds to a .NET class that support - text/value conversion through the TypeConverter architecture. - Classes that don't support this are serialized and stored with the - mimetype set. - - The mimetype is used for serialized objects, and tells the - ResXResourceReader how to depersist the object. This is currently not - extensible. For a given mimetype the value must be set accordingly: - - Note - application/x-microsoft.net.object.binary.base64 is the format - that the ResXResourceWriter will generate, however the reader can - read any of the formats listed below. - - mimetype: application/x-microsoft.net.object.binary.base64 - value : The object must be serialized with - : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter - : and then encoded with base64 encoding. - - mimetype: application/x-microsoft.net.object.soap.base64 - value : The object must be serialized with - : System.Runtime.Serialization.Formatters.Soap.SoapFormatter - : and then encoded with base64 encoding. - - mimetype: application/x-microsoft.net.object.bytearray.base64 - value : The object must be serialized into a byte array - : using a System.ComponentModel.TypeConverter - : and then encoded with base64 encoding. - --> - <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> - <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> - <xsd:element name="root" msdata:IsDataSet="true"> - <xsd:complexType> - <xsd:choice maxOccurs="unbounded"> - <xsd:element name="metadata"> - <xsd:complexType> - <xsd:sequence> - <xsd:element name="value" type="xsd:string" minOccurs="0" /> - </xsd:sequence> - <xsd:attribute name="name" use="required" type="xsd:string" /> - <xsd:attribute name="type" type="xsd:string" /> - <xsd:attribute name="mimetype" type="xsd:string" /> - <xsd:attribute ref="xml:space" /> - </xsd:complexType> - </xsd:element> - <xsd:element name="assembly"> - <xsd:complexType> - <xsd:attribute name="alias" type="xsd:string" /> - <xsd:attribute name="name" type="xsd:string" /> - </xsd:complexType> - </xsd:element> - <xsd:element name="data"> - <xsd:complexType> - <xsd:sequence> - <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> - <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> - </xsd:sequence> - <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> - <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> - <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> - <xsd:attribute ref="xml:space" /> - </xsd:complexType> - </xsd:element> - <xsd:element name="resheader"> - <xsd:complexType> - <xsd:sequence> - <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> - </xsd:sequence> - <xsd:attribute name="name" type="xsd:string" use="required" /> - </xsd:complexType> - </xsd:element> - </xsd:choice> - </xsd:complexType> - </xsd:element> - </xsd:schema> - <resheader name="resmimetype"> - <value>text/microsoft-resx</value> - </resheader> - <resheader name="version"> - <value>2.0</value> - </resheader> - <resheader name="reader"> - <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> - </resheader> - <resheader name="writer"> - <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> - </resheader> -</root>
\ No newline at end of file diff --git a/Software/Visual_Studio/VSIX/Tango.BuildExtensions/Tango.BuildExtensions.csproj b/Software/Visual_Studio/VSIX/Tango.BuildExtensions/Tango.BuildExtensions.csproj index 7148e4761..ffe4eb0d7 100644 --- a/Software/Visual_Studio/VSIX/Tango.BuildExtensions/Tango.BuildExtensions.csproj +++ b/Software/Visual_Studio/VSIX/Tango.BuildExtensions/Tango.BuildExtensions.csproj @@ -72,12 +72,6 @@ <Compile Include="BuildForm.Designer.cs"> <DependentUpon>BuildForm.cs</DependentUpon> </Compile> - <Compile Include="ProgressForm.cs"> - <SubType>Form</SubType> - </Compile> - <Compile Include="ProgressForm.Designer.cs"> - <DependentUpon>ProgressForm.cs</DependentUpon> - </Compile> <Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\Resources.Designer.cs"> <AutoGen>True</AutoGen> @@ -240,9 +234,6 @@ <EmbeddedResource Include="BuildForm.resx"> <DependentUpon>BuildForm.cs</DependentUpon> </EmbeddedResource> - <EmbeddedResource Include="ProgressForm.resx"> - <DependentUpon>ProgressForm.cs</DependentUpon> - </EmbeddedResource> <EmbeddedResource Include="Properties\Resources.resx"> <Generator>ResXFileCodeGenerator</Generator> <LastGenOutput>Resources.Designer.cs</LastGenOutput> diff --git a/Software/Visual_Studio/VSIX/Tango.BuildExtensions/TangoBuildCommand.cs b/Software/Visual_Studio/VSIX/Tango.BuildExtensions/TangoBuildCommand.cs index 9de557117..624124ef2 100644 --- a/Software/Visual_Studio/VSIX/Tango.BuildExtensions/TangoBuildCommand.cs +++ b/Software/Visual_Studio/VSIX/Tango.BuildExtensions/TangoBuildCommand.cs @@ -41,6 +41,7 @@ namespace Tango.BuildExtensions private const String pmrGeneratorProjectName = "Tango.PMRGenerator.CLI"; private const String pmrProjectName = "Tango.PMR"; private const String protoCliProjectName = "Tango.Protobuf.CLI"; + private const String sqliteProjectName = "Tango.SQLiteGenerator.CLI"; #region Redundant @@ -143,7 +144,7 @@ namespace Tango.BuildExtensions _application = TestStack.White.Application.Attach(_vsProcess); _window = _application.GetWindow(vsWindowTitle); - OpenProgressForm(); + OpenVSProgress("Tango Build Engine", "Initializing...", true); try { @@ -163,18 +164,22 @@ namespace Tango.BuildExtensions { UpdateAndBuildPmrMessages(); } + if (buildForm.GenerateSQLite) + { + GenerateSQLite(); + } if (buildForm.BuildSolution) { BuildSolution(); } - SetProgressText("Done!"); + SetVSProgress("Done!"); Wait(1000); - CloseProgressForm(); + CloseVSProgress(); } catch (Exception ex) { - CloseProgressForm(); + CloseVSProgress(); ShowMessage(ex.Message); } }); @@ -191,7 +196,7 @@ namespace Tango.BuildExtensions var projectItems = project.ProjectItems.OfType<ProjectItem>().ToList(); - SetProgressText("Locating " + edmxModelName + " scheme..."); + SetVSProgress("Locating " + edmxModelName + " scheme..."); var items = GetProjectItems(project); @@ -202,20 +207,20 @@ namespace Tango.BuildExtensions throw new NullReferenceException("Could not locate " + edmxModelName + "!"); } - SetProgressText("Expanding diagram..."); + SetVSProgress("Expanding diagram..."); edmx.ExpandView(); - SetProgressText("Opening edmx diagram window..."); + SetVSProgress("Opening EDMX diagram window..."); Window win = edmx.Open(EnvDTE.Constants.vsViewKindPrimary); win.Visible = true; - SetProgressText("Waiting for edmx diagram window..."); + SetVSProgress("Waiting for EDMX diagram window..."); _window.WaitTill(() => _window.Get(SearchCriteria.ByText(edmxModelName + " [Diagram1]")) != null); - SetProgressText("Cleaning up edmx scheme..."); + SetVSProgress("Cleaning up EDMX scheme..."); DTE.MainWindow.Activate(); DTE.ExecuteCommand("Edit.SelectAll"); @@ -225,7 +230,7 @@ namespace Tango.BuildExtensions _window.WaitWhileBusy(); - SetProgressText("Reinitializing edmx scheme..."); + SetVSProgress("Reinitializing EDMX scheme..."); var window = WindowInfo.GetWindow(edmxModelName + " [Diagram1]*"); window.SetActive(); @@ -256,13 +261,13 @@ namespace Tango.BuildExtensions updateWindow.PressKey(KeyboardInput.SpecialKeys.RETURN); - SetProgressText("Generating edmx scheme..."); + SetVSProgress("Generating EDMX scheme..."); WaitForWindowClose("Update Wizard"); _window.WaitWhileBusy(); - SetProgressText("Saving changes..."); + SetVSProgress("Saving changes..."); win.Close(vsSaveChanges.vsSaveChangesYes); @@ -270,14 +275,14 @@ namespace Tango.BuildExtensions foreach (var template in edmx.ProjectItems.OfType<ProjectItem>().Where(x => x.Name.EndsWith(".tt"))) { - SetProgressText("Running custom tool for " + template.Name + "..."); + SetVSProgress("Running custom tool for " + template.Name + "..."); (template.Object as VSProjectItem).RunCustomTool(); _window.WaitWhileBusy(); } _window.WaitWhileBusy(); - SetProgressText("Building project " + dalProjectName + "..."); + SetVSProgress("Building project " + dalProjectName + "..."); DTE.Solution.SolutionBuild.BuildProject("Debug", project.FullName, true); @@ -296,13 +301,13 @@ namespace Tango.BuildExtensions throw new NullReferenceException("Could not locate project " + observablesGeneratorProjectName); } - SetProgressText("Building project " + observablesGeneratorProjectName + "..."); + SetVSProgress("Building project " + observablesGeneratorProjectName + "..."); DTE.Solution.SolutionBuild.BuildProject("Debug", project.FullName, true); DTE.Solution.Properties.Item("StartupProject").Value = observablesGeneratorProjectName; - SetProgressText("Executing observables generator..."); + SetVSProgress("Executing observables generator..."); DTE.ExecuteCommand("Debug.Start"); @@ -317,7 +322,7 @@ namespace Tango.BuildExtensions throw new NullReferenceException("Could not locate project " + observablesProjectName); } - SetProgressText("Updating " + observablesProjectName + "..."); + SetVSProgress("Updating " + observablesProjectName + "..."); foreach (var file in Directory.GetFiles(Path.GetDirectoryName(observablesProject.FileName), "*.cs", SearchOption.AllDirectories)) { @@ -325,13 +330,13 @@ namespace Tango.BuildExtensions if (parentFolderName != "Debug" && parentFolderName != "Release" && parentFolderName != "obj") { - SetProgressText("Adding/Updating file " + Path.GetFileName(file) + "..."); + SetVSProgress("Adding/Updating file " + Path.GetFileName(file) + "..."); observablesProject.ProjectItems.AddFromFile(file); Wait(10); } } - SetProgressText("Building project " + observablesProjectName + "..."); + SetVSProgress("Building project " + observablesProjectName + "..."); DTE.Solution.SolutionBuild.BuildProject("Debug", observablesProject.FullName, true); @@ -350,13 +355,13 @@ namespace Tango.BuildExtensions throw new NullReferenceException("Could not locate project " + pmrGeneratorProjectName); } - SetProgressText("Building project " + pmrGeneratorProjectName + "..."); + SetVSProgress("Building project " + pmrGeneratorProjectName + "..."); DTE.Solution.SolutionBuild.BuildProject("Debug", project.FullName, true); DTE.Solution.Properties.Item("StartupProject").Value = pmrGeneratorProjectName; - SetProgressText("Executing PMR generator..."); + SetVSProgress("Executing PMR generator..."); DTE.ExecuteCommand("Debug.Start"); @@ -374,7 +379,7 @@ namespace Tango.BuildExtensions throw new NullReferenceException("Could not locate project " + protoCliProjectName); } - SetProgressText("Building project " + protoCliProjectName + "..."); + SetVSProgress("Building project " + protoCliProjectName + "..."); DTE.Solution.SolutionBuild.BuildProject("Debug", protoProject.FullName, true); @@ -385,7 +390,7 @@ namespace Tango.BuildExtensions DTE.Solution.Properties.Item("StartupProject").Value = protoCliProjectName; - SetProgressText("Executing Tango Proto Compiler..."); + SetVSProgress("Executing Tango Proto Compiler..."); DTE.ExecuteCommand("Debug.Start"); @@ -401,7 +406,7 @@ namespace Tango.BuildExtensions throw new NullReferenceException("Could not locate project " + pmrProjectName); } - SetProgressText("Updating " + pmrProjectName + "..."); + SetVSProgress("Updating " + pmrProjectName + "..."); foreach (var file in Directory.GetFiles(Path.GetDirectoryName(project.FileName), "*.cs", SearchOption.AllDirectories)) { @@ -409,13 +414,13 @@ namespace Tango.BuildExtensions if (parentFolderName != "Debug" && parentFolderName != "Release" && parentFolderName != "obj") { - SetProgressText("Adding/Updating file " + Path.GetFileName(file) + "..."); + SetVSProgress("Adding/Updating file " + Path.GetFileName(file) + "..."); project.ProjectItems.AddFromFile(file); Wait(10); } } - SetProgressText("Building project " + pmrProjectName + "..."); + SetVSProgress("Building project " + pmrProjectName + "..."); DTE.Solution.SolutionBuild.BuildProject("Debug", project.FullName, true); @@ -425,9 +430,33 @@ namespace Tango.BuildExtensions } } + private void GenerateSQLite() + { + var project = _projects.SingleOrDefault(x => x.Name == sqliteProjectName); + + if (project == null) + { + throw new NullReferenceException("Could not locate project " + sqliteProjectName); + } + + SetVSProgress("Building project " + sqliteProjectName + "..."); + + DTE.Solution.SolutionBuild.BuildProject("Debug", project.FullName, true); + + DTE.Solution.Properties.Item("StartupProject").Value = sqliteProjectName; + + SetVSProgress("Executing SQLite generator..."); + + DTE.ExecuteCommand("Debug.Start"); + + WaitForWindowOpen("Tango SQLite Generator"); + + WaitForWindowClose("Tango SQLite Generator"); + } + private void BuildSolution() { - SetProgressText("Building solution..."); + SetVSProgress("Building solution..."); DTE.Solution.SolutionBuild.Build(true); if (DTE.Solution.SolutionBuild.LastBuildInfo > 0) diff --git a/Software/Visual_Studio/VSIX/Tango.BuildExtensions/VSIXBase.cs b/Software/Visual_Studio/VSIX/Tango.BuildExtensions/VSIXBase.cs index 50860cfa3..3957bbfdf 100644 --- a/Software/Visual_Studio/VSIX/Tango.BuildExtensions/VSIXBase.cs +++ b/Software/Visual_Studio/VSIX/Tango.BuildExtensions/VSIXBase.cs @@ -21,7 +21,6 @@ namespace Tango.BuildExtensions { public class VSIXBase { - private SelectForm _form; private IVsThreadedWaitDialog2 _vsProgress = null; public IServiceProvider BaseServiceProvider { get; private set; } @@ -155,7 +154,7 @@ namespace Tango.BuildExtensions VsShellUtilities.ShowMessageBox( BaseServiceProvider, text, - "Tango Initializer", + "Tango", OLEMSGICON.OLEMSGICON_INFO, OLEMSGBUTTON.OLEMSGBUTTON_OK, OLEMSGDEFBUTTON.OLEMSGDEFBUTTON_FIRST); @@ -245,44 +244,6 @@ namespace Tango.BuildExtensions }); } - protected void OpenProgressForm() - { - System.Threading.Thread thread = new System.Threading.Thread(() => - { - _form = new SelectForm(); - var handle = _form.Handle; - _form.ShowDialog(); - }); - - thread.SetApartmentState(System.Threading.ApartmentState.STA); - thread.Start(); - - while (_form == null || !_form.IsHandleCreated) { } - } - - protected void SetProgressText(String text) - { - if (_form != null) - { - _form.Invoke(new Action(() => - { - _form.SetStatus(text); - })); - } - } - - protected void CloseProgressForm() - { - if (_form != null) - { - _form.Invoke(new Action(() => - { - _form.Close(); - _form = null; - })); - } - } - #endregion #region Content |
