diff --git a/Code/TSqlFlex/AboutBox.Designer.cs b/Code/TSqlFlex/AboutBox.Designer.cs index b1ec1d8..bbf6ed1 100644 --- a/Code/TSqlFlex/AboutBox.Designer.cs +++ b/Code/TSqlFlex/AboutBox.Designer.cs @@ -27,119 +27,142 @@ protected override void Dispose(bool disposing) /// private void InitializeComponent() { - this.tableLayoutPanel = new System.Windows.Forms.TableLayoutPanel(); this.labelProductName = new System.Windows.Forms.Label(); this.labelVersion = new System.Windows.Forms.Label(); this.labelCopyright = new System.Windows.Forms.Label(); this.labelCompanyName = new System.Windows.Forms.Label(); - this.textBoxDescription = new System.Windows.Forms.TextBox(); - this.okButton = new System.Windows.Forms.Button(); - this.tableLayoutPanel.SuspendLayout(); + this.btnClose = new System.Windows.Forms.Button(); + this.lblKudos = new System.Windows.Forms.Label(); + this.btnTwitter = new System.Windows.Forms.Button(); + this.lblIssue = new System.Windows.Forms.Label(); + this.btnIssues = new System.Windows.Forms.Button(); + this.label1 = new System.Windows.Forms.Label(); + this.btnReleases = new System.Windows.Forms.Button(); this.SuspendLayout(); // - // tableLayoutPanel - // - this.tableLayoutPanel.ColumnCount = 2; - this.tableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 1.918465F)); - this.tableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 98.08154F)); - this.tableLayoutPanel.Controls.Add(this.labelProductName, 1, 0); - this.tableLayoutPanel.Controls.Add(this.labelVersion, 1, 1); - this.tableLayoutPanel.Controls.Add(this.labelCopyright, 1, 2); - this.tableLayoutPanel.Controls.Add(this.labelCompanyName, 1, 3); - this.tableLayoutPanel.Controls.Add(this.textBoxDescription, 1, 4); - this.tableLayoutPanel.Controls.Add(this.okButton, 1, 5); - this.tableLayoutPanel.Dock = System.Windows.Forms.DockStyle.Fill; - this.tableLayoutPanel.Location = new System.Drawing.Point(9, 9); - this.tableLayoutPanel.Name = "tableLayoutPanel"; - this.tableLayoutPanel.RowCount = 6; - this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F)); - this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F)); - this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F)); - this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F)); - this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F)); - this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F)); - this.tableLayoutPanel.Size = new System.Drawing.Size(417, 265); - this.tableLayoutPanel.TabIndex = 0; - // // labelProductName // - this.labelProductName.Dock = System.Windows.Forms.DockStyle.Fill; - this.labelProductName.Location = new System.Drawing.Point(13, 0); - this.labelProductName.Margin = new System.Windows.Forms.Padding(6, 0, 3, 0); - this.labelProductName.MaximumSize = new System.Drawing.Size(0, 17); + this.labelProductName.AutoSize = true; + this.labelProductName.Location = new System.Drawing.Point(12, 9); this.labelProductName.Name = "labelProductName"; - this.labelProductName.Size = new System.Drawing.Size(401, 17); - this.labelProductName.TabIndex = 19; - this.labelProductName.Text = "Product Name"; - this.labelProductName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.labelProductName.Size = new System.Drawing.Size(72, 13); + this.labelProductName.TabIndex = 2; + this.labelProductName.Text = "ProductName"; // // labelVersion // - this.labelVersion.Dock = System.Windows.Forms.DockStyle.Fill; - this.labelVersion.Location = new System.Drawing.Point(13, 26); - this.labelVersion.Margin = new System.Windows.Forms.Padding(6, 0, 3, 0); - this.labelVersion.MaximumSize = new System.Drawing.Size(0, 17); + this.labelVersion.AutoSize = true; + this.labelVersion.Location = new System.Drawing.Point(12, 33); this.labelVersion.Name = "labelVersion"; - this.labelVersion.Size = new System.Drawing.Size(401, 17); - this.labelVersion.TabIndex = 0; + this.labelVersion.Size = new System.Drawing.Size(42, 13); + this.labelVersion.TabIndex = 3; this.labelVersion.Text = "Version"; - this.labelVersion.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // labelCopyright // - this.labelCopyright.Dock = System.Windows.Forms.DockStyle.Fill; - this.labelCopyright.Location = new System.Drawing.Point(13, 52); - this.labelCopyright.Margin = new System.Windows.Forms.Padding(6, 0, 3, 0); - this.labelCopyright.MaximumSize = new System.Drawing.Size(0, 17); + this.labelCopyright.AutoSize = true; + this.labelCopyright.Location = new System.Drawing.Point(12, 58); this.labelCopyright.Name = "labelCopyright"; - this.labelCopyright.Size = new System.Drawing.Size(401, 17); - this.labelCopyright.TabIndex = 21; + this.labelCopyright.Size = new System.Drawing.Size(51, 13); + this.labelCopyright.TabIndex = 4; this.labelCopyright.Text = "Copyright"; - this.labelCopyright.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // labelCompanyName // - this.labelCompanyName.Dock = System.Windows.Forms.DockStyle.Fill; - this.labelCompanyName.Location = new System.Drawing.Point(13, 78); - this.labelCompanyName.Margin = new System.Windows.Forms.Padding(6, 0, 3, 0); - this.labelCompanyName.MaximumSize = new System.Drawing.Size(0, 17); + this.labelCompanyName.AutoSize = true; + this.labelCompanyName.Location = new System.Drawing.Point(12, 83); this.labelCompanyName.Name = "labelCompanyName"; - this.labelCompanyName.Size = new System.Drawing.Size(401, 17); - this.labelCompanyName.TabIndex = 22; - this.labelCompanyName.Text = "Company Name"; - this.labelCompanyName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // textBoxDescription - // - this.textBoxDescription.Dock = System.Windows.Forms.DockStyle.Fill; - this.textBoxDescription.Location = new System.Drawing.Point(13, 107); - this.textBoxDescription.Margin = new System.Windows.Forms.Padding(6, 3, 3, 3); - this.textBoxDescription.Multiline = true; - this.textBoxDescription.Name = "textBoxDescription"; - this.textBoxDescription.ReadOnly = true; - this.textBoxDescription.ScrollBars = System.Windows.Forms.ScrollBars.Both; - this.textBoxDescription.Size = new System.Drawing.Size(401, 126); - this.textBoxDescription.TabIndex = 23; - this.textBoxDescription.TabStop = false; - this.textBoxDescription.Text = "Description"; - // - // okButton - // - this.okButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.okButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.okButton.Location = new System.Drawing.Point(339, 239); - this.okButton.Name = "okButton"; - this.okButton.Size = new System.Drawing.Size(75, 23); - this.okButton.TabIndex = 24; - this.okButton.Text = "&OK"; + this.labelCompanyName.Size = new System.Drawing.Size(79, 13); + this.labelCompanyName.TabIndex = 5; + this.labelCompanyName.Text = "CompanyName"; + // + // btnClose + // + this.btnClose.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.btnClose.Location = new System.Drawing.Point(201, 215); + this.btnClose.Name = "btnClose"; + this.btnClose.Size = new System.Drawing.Size(75, 23); + this.btnClose.TabIndex = 6; + this.btnClose.Text = "Close"; + this.btnClose.UseVisualStyleBackColor = true; + this.btnClose.Click += new System.EventHandler(this.btnClose_Click); + // + // lblKudos + // + this.lblKudos.AutoSize = true; + this.lblKudos.Location = new System.Drawing.Point(12, 122); + this.lblKudos.Name = "lblKudos"; + this.lblKudos.Size = new System.Drawing.Size(153, 13); + this.lblKudos.TabIndex = 7; + this.lblKudos.Text = "Tell Steve you like T-SQL Flex:"; + // + // btnTwitter + // + this.btnTwitter.ForeColor = System.Drawing.Color.Blue; + this.btnTwitter.Location = new System.Drawing.Point(201, 116); + this.btnTwitter.Name = "btnTwitter"; + this.btnTwitter.Size = new System.Drawing.Size(80, 25); + this.btnTwitter.TabIndex = 8; + this.btnTwitter.Text = "@nycdotnet"; + this.btnTwitter.UseVisualStyleBackColor = true; + this.btnTwitter.Click += new System.EventHandler(this.btnTwitter_Click); + // + // lblIssue + // + this.lblIssue.AutoSize = true; + this.lblIssue.Location = new System.Drawing.Point(12, 153); + this.lblIssue.Name = "lblIssue"; + this.lblIssue.Size = new System.Drawing.Size(85, 13); + this.lblIssue.TabIndex = 9; + this.lblIssue.Text = "Report an Issue:"; + // + // btnIssues + // + this.btnIssues.ForeColor = System.Drawing.Color.Blue; + this.btnIssues.Location = new System.Drawing.Point(167, 147); + this.btnIssues.Name = "btnIssues"; + this.btnIssues.Size = new System.Drawing.Size(113, 25); + this.btnIssues.TabIndex = 10; + this.btnIssues.Text = "TSqlFlex/issues"; + this.btnIssues.UseVisualStyleBackColor = true; + this.btnIssues.Click += new System.EventHandler(this.btnIssues_Click); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(12, 184); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(107, 13); + this.label1.TabIndex = 11; + this.label1.Text = "Check for an update:"; + // + // btnReleases + // + this.btnReleases.ForeColor = System.Drawing.Color.Blue; + this.btnReleases.Location = new System.Drawing.Point(168, 178); + this.btnReleases.Name = "btnReleases"; + this.btnReleases.Size = new System.Drawing.Size(113, 25); + this.btnReleases.TabIndex = 12; + this.btnReleases.Text = "TSqlFlex/releases"; + this.btnReleases.UseVisualStyleBackColor = true; + this.btnReleases.Click += new System.EventHandler(this.btnReleases_Click); // // AboutBox // - this.AcceptButton = this.okButton; this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(435, 283); - this.Controls.Add(this.tableLayoutPanel); + this.ClientSize = new System.Drawing.Size(288, 250); + this.Controls.Add(this.btnReleases); + this.Controls.Add(this.label1); + this.Controls.Add(this.btnIssues); + this.Controls.Add(this.lblIssue); + this.Controls.Add(this.btnTwitter); + this.Controls.Add(this.lblKudos); + this.Controls.Add(this.btnClose); + this.Controls.Add(this.labelCompanyName); + this.Controls.Add(this.labelCopyright); + this.Controls.Add(this.labelVersion); + this.Controls.Add(this.labelProductName); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; this.MaximizeBox = false; this.MinimizeBox = false; @@ -149,20 +172,24 @@ private void InitializeComponent() this.ShowInTaskbar = false; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.Text = "AboutBox"; - this.tableLayoutPanel.ResumeLayout(false); - this.tableLayoutPanel.PerformLayout(); this.ResumeLayout(false); + this.PerformLayout(); } #endregion - private System.Windows.Forms.TableLayoutPanel tableLayoutPanel; private System.Windows.Forms.Label labelProductName; private System.Windows.Forms.Label labelVersion; private System.Windows.Forms.Label labelCopyright; private System.Windows.Forms.Label labelCompanyName; - private System.Windows.Forms.TextBox textBoxDescription; - private System.Windows.Forms.Button okButton; + private System.Windows.Forms.Button btnClose; + private System.Windows.Forms.Label lblKudos; + private System.Windows.Forms.Button btnTwitter; + private System.Windows.Forms.Label lblIssue; + private System.Windows.Forms.Button btnIssues; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Button btnReleases; + } } diff --git a/Code/TSqlFlex/AboutBox.cs b/Code/TSqlFlex/AboutBox.cs index 2232ee2..12fdcde 100644 --- a/Code/TSqlFlex/AboutBox.cs +++ b/Code/TSqlFlex/AboutBox.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.ComponentModel; +using System.Diagnostics; using System.Drawing; using System.Linq; using System.Reflection; @@ -16,96 +17,54 @@ public AboutBox() string productName = "T-SQL Flex"; string companyName = "LegendaryApps.com"; - string description = "Kudos? Tweet Steve at https://twitter.com/nycdotnet \r\n" + - "Trouble? Log an issue here: https://github.com/nycdotnet/TSqlFlex/issues \r\n" + - "Latest version available here: https://github.com/nycdotnet/TSqlFlex/releases"; - this.Text = String.Format("About {0}", productName); this.labelProductName.Text = productName; this.labelVersion.Text = String.Format("Version {0}", TSqlFlex.Core.Info.Version()); this.labelCopyright.Text = AssemblyCopyright; this.labelCompanyName.Text = companyName; - this.textBoxDescription.Text = description; } - #region Assembly Attribute Accessors - - public string AssemblyTitle + public string AssemblyCopyright { get { - object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyTitleAttribute), false); - if (attributes.Length > 0) + object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false); + if (attributes.Length == 0) { - AssemblyTitleAttribute titleAttribute = (AssemblyTitleAttribute)attributes[0]; - if (titleAttribute.Title != "") - { - return titleAttribute.Title; - } + return ""; } - return System.IO.Path.GetFileNameWithoutExtension(Assembly.GetExecutingAssembly().CodeBase); + return ((AssemblyCopyrightAttribute)attributes[0]).Copyright; } } - public string AssemblyVersion + private void btnClose_Click(object sender, EventArgs e) { - get - { - return Assembly.GetExecutingAssembly().GetName().Version.ToString(); - } + this.Close(); } - public string AssemblyDescription + private void btnTwitter_Click(object sender, EventArgs e) { - get - { - object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyDescriptionAttribute), false); - if (attributes.Length == 0) - { - return ""; - } - return ((AssemblyDescriptionAttribute)attributes[0]).Description; - } + launchUrl("https://twitter.com/nycdotnet/"); } - public string AssemblyProduct + private void btnIssues_Click(object sender, EventArgs e) { - get - { - object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyProductAttribute), false); - if (attributes.Length == 0) - { - return ""; - } - return ((AssemblyProductAttribute)attributes[0]).Product; - } + launchUrl("https://github.com/nycdotnet/TSqlFlex/issues"); } - public string AssemblyCopyright + private void btnReleases_Click(object sender, EventArgs e) { - get - { - object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false); - if (attributes.Length == 0) - { - return ""; - } - return ((AssemblyCopyrightAttribute)attributes[0]).Copyright; - } + launchUrl("https://github.com/nycdotnet/TSqlFlex/releases"); } - public string AssemblyCompany + private void launchUrl(string url) { - get - { - object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCompanyAttribute), false); - if (attributes.Length == 0) - { - return ""; - } - return ((AssemblyCompanyAttribute)attributes[0]).Company; - } + Process proc = new Process(); + proc.StartInfo.UseShellExecute = true; + proc.StartInfo.FileName = url; + proc.Start(); } - #endregion + + } }