Develop and Download Open Source Software

Browse Subversion Repository

Contents of /UT3 Server Launcher/AboutBox1.cs

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1 - (show annotations) (download)
Thu Jun 11 12:13:07 2009 UTC (14 years, 9 months ago) by piglet
File size: 3495 byte(s)


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 UT3_Server_Launcher
10 {
11 partial class AboutBox1 : Form
12 {
13 public AboutBox1()
14 {
15 InitializeComponent();
16 this.Text = String.Format("{0} のバージョン情報 {0}", AssemblyTitle);
17 this.labelProductName.Text = AssemblyProduct;
18 this.labelVersion.Text = String.Format("バージョン {0} {0}", AssemblyVersion);
19 this.labelCopyright.Text = AssemblyCopyright;
20 this.labelCompanyName.Text = AssemblyCompany;
21 this.textBoxDescription.Text = AssemblyDescription;
22 }
23
24 #region アセンブリ属性アクセサ
25
26 public string AssemblyTitle
27 {
28 get
29 {
30 object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyTitleAttribute), false);
31 if (attributes.Length > 0)
32 {
33 AssemblyTitleAttribute titleAttribute = (AssemblyTitleAttribute)attributes[0];
34 if (titleAttribute.Title != "")
35 {
36 return titleAttribute.Title;
37 }
38 }
39 return System.IO.Path.GetFileNameWithoutExtension(Assembly.GetExecutingAssembly().CodeBase);
40 }
41 }
42
43 public string AssemblyVersion
44 {
45 get
46 {
47 return Assembly.GetExecutingAssembly().GetName().Version.ToString();
48 }
49 }
50
51 public string AssemblyDescription
52 {
53 get
54 {
55 object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyDescriptionAttribute), false);
56 if (attributes.Length == 0)
57 {
58 return "";
59 }
60 return ((AssemblyDescriptionAttribute)attributes[0]).Description;
61 }
62 }
63
64 public string AssemblyProduct
65 {
66 get
67 {
68 object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyProductAttribute), false);
69 if (attributes.Length == 0)
70 {
71 return "";
72 }
73 return ((AssemblyProductAttribute)attributes[0]).Product;
74 }
75 }
76
77 public string AssemblyCopyright
78 {
79 get
80 {
81 object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false);
82 if (attributes.Length == 0)
83 {
84 return "";
85 }
86 return ((AssemblyCopyrightAttribute)attributes[0]).Copyright;
87 }
88 }
89
90 public string AssemblyCompany
91 {
92 get
93 {
94 object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCompanyAttribute), false);
95 if (attributes.Length == 0)
96 {
97 return "";
98 }
99 return ((AssemblyCompanyAttribute)attributes[0]).Company;
100 }
101 }
102 #endregion
103 }
104 }

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26