Skip to content

Commit ee47309

Browse files
committed
Add AboutBox, TestForm, improve responsiveness
Add TestForm to run test suite Improve responsiveness of scrollbar and GraphicsViewer Move codec into N64Graphics class
1 parent 77fd272 commit ee47309

27 files changed

Lines changed: 2418 additions & 777 deletions

Texture64/AboutBox.Designer.cs

Lines changed: 178 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Texture64/AboutBox.cs

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
using System;
2+
using System.Drawing;
3+
using System.Reflection;
4+
using System.Windows.Forms;
5+
using Texture64.Properties;
6+
7+
namespace Texture64
8+
{
9+
partial class AboutBox : Form
10+
{
11+
private int frame = 0;
12+
private readonly Bitmap[] frameImages = new Bitmap[] {
13+
Resources.flower_0,
14+
Resources.flower_1,
15+
Resources.flower_2,
16+
Resources.flower_3,
17+
Resources.flower_3,
18+
Resources.flower_2,
19+
Resources.flower_1,
20+
Resources.flower_0
21+
};
22+
public AboutBox()
23+
{
24+
InitializeComponent();
25+
this.Text = String.Format("About {0}", AssemblyTitle);
26+
this.labelProductName.Text = AssemblyProduct;
27+
this.labelVersion.Text = String.Format("Version {0}", AssemblyVersion);
28+
this.labelCopyright.Text = AssemblyCopyright;
29+
this.textBoxDescription.Text = AssemblyDescription;
30+
}
31+
32+
#region Assembly Attribute Accessors
33+
34+
public string AssemblyTitle
35+
{
36+
get
37+
{
38+
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyTitleAttribute), false);
39+
if (attributes.Length > 0)
40+
{
41+
AssemblyTitleAttribute titleAttribute = (AssemblyTitleAttribute)attributes[0];
42+
if (titleAttribute.Title != "")
43+
{
44+
return titleAttribute.Title;
45+
}
46+
}
47+
return System.IO.Path.GetFileNameWithoutExtension(Assembly.GetExecutingAssembly().CodeBase);
48+
}
49+
}
50+
51+
public string AssemblyVersion
52+
{
53+
get
54+
{
55+
return Assembly.GetExecutingAssembly().GetName().Version.ToString();
56+
}
57+
}
58+
59+
public string AssemblyDescription
60+
{
61+
get
62+
{
63+
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyDescriptionAttribute), false);
64+
if (attributes.Length == 0)
65+
{
66+
return "";
67+
}
68+
return ((AssemblyDescriptionAttribute)attributes[0]).Description;
69+
}
70+
}
71+
72+
public string AssemblyProduct
73+
{
74+
get
75+
{
76+
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyProductAttribute), false);
77+
if (attributes.Length == 0)
78+
{
79+
return "";
80+
}
81+
return ((AssemblyProductAttribute)attributes[0]).Product;
82+
}
83+
}
84+
85+
public string AssemblyCopyright
86+
{
87+
get
88+
{
89+
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false);
90+
if (attributes.Length == 0)
91+
{
92+
return "";
93+
}
94+
return ((AssemblyCopyrightAttribute)attributes[0]).Copyright;
95+
}
96+
}
97+
98+
public string AssemblyCompany
99+
{
100+
get
101+
{
102+
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCompanyAttribute), false);
103+
if (attributes.Length == 0)
104+
{
105+
return "";
106+
}
107+
return ((AssemblyCompanyAttribute)attributes[0]).Company;
108+
}
109+
}
110+
#endregion
111+
112+
private void timerAnimate_Tick(object sender, EventArgs e)
113+
{
114+
frame++;
115+
if (frame >= frameImages.Length)
116+
{
117+
frame = 0;
118+
}
119+
logoPictureBox.Image = frameImages[frame];
120+
logoPictureBox.Refresh();
121+
}
122+
}
123+
}

0 commit comments

Comments
 (0)