About.cs (3302B)
1 using System; 2 using System.Reflection; 3 using System.Windows.Forms; 4 5 namespace SilkypixFileMover 6 { 7 partial class About : Form 8 { 9 public About() 10 { 11 InitializeComponent(); 12 labelProductName.Text = AssemblyProduct; 13 labelVersion.Text = string.Format( "Version {0}", AssemblyVersion ); 14 labelCopyright.Text = AssemblyCopyright; 15 textBoxDescription.Text = @"BSD 3-Clause License 16 17 hosted on GitLab: https://gitlab.com/guzzisti1/rawfilewizard 18 19 Using Farm Fresh Icons von FatCow Webhosting: http://www.fatcow.com/free-icons"; 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 }