1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Drawing;
  5. using System.Linq;
  6. using System.Reflection;
  7. using System.Windows.Forms;
  8.  
  9. namespace DNS_Manager
  10. {
  11.     partial class About : Form
  12.     {
  13.         public About()
  14.         {
  15.             InitializeComponent();
  16.             this.Text = String.Format("About {0}", AssemblyTitle);
  17.             this.labelProductName.Text = AssemblyProduct;
  18.             this.labelVersion.Text = String.Format("Version {0}", AssemblyVersion);
  19.             this.labelCopyright.Text = AssemblyCopyright;
  20.         }
  21.  
  22.         #region Assembly Attribute Accessors
  23.  
  24.         public string AssemblyTitle
  25.         {
  26.             get
  27.             {
  28.                 object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyTitleAttribute), false);
  29.                 if (attributes.Length > 0)
  30.                 {
  31.                     AssemblyTitleAttribute titleAttribute = (AssemblyTitleAttribute)attributes[0];
  32.                     if (titleAttribute.Title != "")
  33.                     {
  34.                         return titleAttribute.Title;
  35.                     }
  36.                 }
  37.                 return System.IO.Path.GetFileNameWithoutExtension(Assembly.GetExecutingAssembly().CodeBase);
  38.             }
  39.         }
  40.  
  41.         public string AssemblyVersion
  42.         {
  43.             get
  44.             {
  45.                 return Assembly.GetExecutingAssembly().GetName().Version.ToString();
  46.             }
  47.         }
  48.  
  49.         public string AssemblyDescription
  50.         {
  51.             get
  52.             {
  53.                 object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyDescriptionAttribute), false);
  54.                 if (attributes.Length == 0)
  55.                 {
  56.                     return "";
  57.                 }
  58.                 return ((AssemblyDescriptionAttribute)attributes[0]).Description;
  59.             }
  60.         }
  61.  
  62.         public string AssemblyProduct
  63.         {
  64.             get
  65.             {
  66.                 object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyProductAttribute), false);
  67.                 if (attributes.Length == 0)
  68.                 {
  69.                     return "";
  70.                 }
  71.                 return ((AssemblyProductAttribute)attributes[0]).Product;
  72.             }
  73.         }
  74.  
  75.         public string AssemblyCopyright
  76.         {
  77.             get
  78.             {
  79.                 object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false);
  80.                 if (attributes.Length == 0)
  81.                 {
  82.                     return "";
  83.                 }
  84.                 return ((AssemblyCopyrightAttribute)attributes[0]).Copyright;
  85.             }
  86.         }
  87.  
  88.         public string AssemblyCompany
  89.         {
  90.             get
  91.             {
  92.                 object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCompanyAttribute), false);
  93.                 if (attributes.Length == 0)
  94.                 {
  95.                     return "";
  96.                 }
  97.                 return ((AssemblyCompanyAttribute)attributes[0]).Company;
  98.             }
  99.         }
  100.         #endregion
  101.     }
  102. }
  103.