Skip to content

Commit 7493e75

Browse files
committed
Added version number to options form.
Fixed issue causing options form to display under net graph when topmost. Changed version number 1.1.0 -> 1.2.0.
1 parent 1d49c2b commit 7493e75

File tree

7 files changed

+38
-11
lines changed

7 files changed

+38
-11
lines changed

Source/Forms/NetGraphForm.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ private void reset_Click(object sender, EventArgs e) {
210210
private void settings_Click(object sender, EventArgs e) {
211211
using (var optionsForm = new OptionsForm(Options.Clone())) {
212212
optionsForm.Icon = Icon;
213+
optionsForm.TopMost = TopMost;
213214
optionsForm.ApplyOptions += (_, options) => {
214215
Options = options.Clone();
215216
};

Source/Forms/OptionsForm.Designer.cs

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

Source/Forms/OptionsForm.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ internal OptionsForm(Options options) {
1616
registry = new RegistryPersister(new RegistryOptions());
1717

1818
InitializeComponent();
19+
version.Text = string.Format(version.Text, UdmApplication.CanonicalProductVersion);
20+
1921
LoadNetworkInterfaces();
2022
LoadSettings();
2123

Source/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ internal static class Program {
1010
private static void Main() {
1111
Application.EnableVisualStyles();
1212
Application.SetCompatibleTextRenderingDefault(false);
13-
Application.Run(new UdmApplicationContext(new NetGraphForm()));
13+
Application.Run(new UdmApplication(new NetGraphForm()));
1414
}
1515
}
1616
}

Source/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,5 @@
3131
// You can specify all the values or you can default the Build and Revision Numbers
3232
// by using the '*' as shown below:
3333
// [assembly: AssemblyVersion("1.0.*")]
34-
[assembly: AssemblyVersion("1.1.0.0")]
35-
[assembly: AssemblyFileVersion("1.1.0.0")]
34+
[assembly: AssemblyVersion("1.2.0.0")]
35+
[assembly: AssemblyFileVersion("1.2.0.0")]
Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,22 @@
33
using System.Windows.Forms;
44

55
namespace ScriptFUSION.UpDown_Meter {
6-
internal class UdmApplicationContext : ApplicationContext {
6+
internal class UdmApplication : ApplicationContext {
77
// It is paramount to hide the base property because the setter forces the form to be visible.
88
public new Form MainForm { get; private set; }
99

10-
public UdmApplicationContext(Form mainForm) {
10+
public UdmApplication(Form mainForm) {
1111
MainForm = mainForm;
1212

1313
mainForm.FormClosed += delegate { ExitThread(); };
1414
}
15+
16+
public static string CanonicalProductVersion
17+
{
18+
get
19+
{
20+
return string.Join(".", Application.ProductVersion.Split('.').TakeWhile((s, i) => i < 3));
21+
}
22+
}
1523
}
1624
}

Source/UpDown Meter.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@
128128
<Compile Include="Sample.cs" />
129129
<Compile Include="Properties\Settings.cs" />
130130
<Compile Include="TrayIconIllustrator.cs" />
131-
<Compile Include="UdmApplicationContext.cs" />
131+
<Compile Include="UdmApplication.cs" />
132132
<EmbeddedResource Include="Controls\NetGraph.resx">
133133
<DependentUpon>NetGraph.cs</DependentUpon>
134134
</EmbeddedResource>

0 commit comments

Comments
 (0)