using System; using System.Reflection; using System.Text; using System.Windows.Forms; using MusicMetaTagger.UI.Properties; namespace MusicMetaTagger.UI { public partial class About : Form { public About() { InitializeComponent(); } private void closeButton_Click(object sender, EventArgs e) { Close(); } private void About_Load(object sender, EventArgs e) { var thisAssembly = Assembly.GetExecutingAssembly(); var assemblyName = thisAssembly.GetName(); var friendlyVersion = string.Format("{0:D}.{1:D2}.{2:D4}", assemblyName.Version.Major, assemblyName.Version.Minor, assemblyName.Version.Build); Array attribute = thisAssembly.GetCustomAttributes(false); var title = "Unknown Application"; var copywrite = "Unknown Copyright"; foreach (object o in attribute) { if (o is AssemblyTitleAttribute) { title = ((AssemblyTitleAttribute) o).Title; } else if (o is AssemblyCopyrightAttribute) { copywrite = ((AssemblyCopyrightAttribute) o).Copyright; } } Text = "About " + title; var sb = new StringBuilder(); sb.Append(title); sb.Append(" version "); sb.Append(friendlyVersion); sb.Append(" ("); sb.Append(assemblyName.Version.ToString()); sb.Append(")\n\n"); sb.Append(copywrite); textLabel.Text = sb.ToString(); textBox.Text = Settings.Default.AboutText; } private void textBox_KeyDown(object sender, KeyEventArgs e) { e.SuppressKeyPress = true; } } }