Skip to content

Commit

Permalink
AboutBox overhaul
Browse files Browse the repository at this point in the history
  • Loading branch information
nycdotnet committed Sep 6, 2014
1 parent 63ae533 commit 0b57352
Show file tree
Hide file tree
Showing 2 changed files with 138 additions and 152 deletions.
207 changes: 117 additions & 90 deletions Code/TSqlFlex/AboutBox.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

83 changes: 21 additions & 62 deletions Code/TSqlFlex/AboutBox.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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


}
}

0 comments on commit 0b57352

Please sign in to comment.