Subversion Repositories AndroidProjects

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1410 chris 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.Threading.Tasks;
8
using System.Windows.Forms;
9
 
10
namespace ShapeEditor
11
{
12
    partial class AboutBox : Form
13
    {
14
        public AboutBox()
15
        {
16
            InitializeComponent();
17
            this.Text = String.Format("About {0}", AssemblyTitle);
18
            this.labelProductName.Text = AssemblyProduct;
19
            this.labelVersion.Text = String.Format("Version {0}", AssemblyVersion);
20
            this.labelCopyright.Text = AssemblyCopyright;
21
            this.labelCompanyName.Text = AssemblyCompany;
22
        }
23
 
24
        #region Assembly Attribute Accessors
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
}