Add support for an about menu

This commit is contained in:
2018-02-22 12:03:53 -05:00
parent c9041badbe
commit 7be7af5980
8 changed files with 55 additions and 0 deletions

View File

@@ -118,6 +118,15 @@ namespace FloatingStatusWindowLibrary
contextMenu.Items.Add(new Separator());
if (_windowSource.HasAboutMenu)
{
menuItem = new MenuItem { Header = Resources.ContextMenuAbout };
menuItem.Click += (sender, args) => _windowSource.ShowAbout();
contextMenu.Items.Add(menuItem);
contextMenu.Items.Add(new Separator());
}
menuItem = new MenuItem
{
Name = "contextMenuItemExit",

View File

@@ -10,8 +10,10 @@ namespace FloatingStatusWindowLibrary
bool HasSettingsMenu { get; }
bool HasRefreshMenu { get; }
bool HasAboutMenu { get; }
void ShowSettings();
void Refresh();
void ShowAbout();
}
}

View File

@@ -105,6 +105,15 @@ namespace FloatingStatusWindowLibrary.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to About.
/// </summary>
public static string ContextMenuAbout {
get {
return ResourceManager.GetString("ContextMenuAbout", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Start with Windows.
/// </summary>

View File

@@ -132,6 +132,9 @@
<data name="ChangeAppearanceWindow" xml:space="preserve">
<value>Change Appearance</value>
</data>
<data name="ContextMenuAbout" xml:space="preserve">
<value>About</value>
</data>
<data name="ContextMenuAutoStart" xml:space="preserve">
<value>Start with Windows</value>
</data>

View File

@@ -1,6 +1,7 @@
using FloatingStatusWindowLibrary;
using System;
using System.Globalization;
using System.Reflection;
using System.Timers;
using System.Windows.Threading;
@@ -53,6 +54,13 @@ namespace TestWindow
get { return true; }
}
public bool HasAboutMenu => true;
public void ShowAbout()
{
_floatingStatusWindow.SetText(Assembly.GetEntryAssembly().GetName().Version.ToString());
}
public void ShowSettings()
{

View File

@@ -1,6 +1,7 @@
using FloatingStatusWindowLibrary;
using System;
using System.Globalization;
using System.Reflection;
using System.Timers;
using System.Windows.Threading;
@@ -53,6 +54,13 @@ namespace TestWindow
get { return true; }
}
public bool HasAboutMenu => true;
public void ShowAbout()
{
_floatingStatusWindow.SetText(Assembly.GetEntryAssembly().GetName().Version.ToString());
}
public void ShowSettings()
{

View File

@@ -1,6 +1,7 @@
using FloatingStatusWindowLibrary;
using System;
using System.Globalization;
using System.Reflection;
using System.Timers;
using System.Windows.Threading;
@@ -53,6 +54,13 @@ namespace TestWindow
get { return true; }
}
public bool HasAboutMenu => true;
public void ShowAbout()
{
_floatingStatusWindow.SetText(Assembly.GetEntryAssembly().GetName().Version.ToString());
}
public void ShowSettings()
{

View File

@@ -1,6 +1,7 @@
using FloatingStatusWindowLibrary;
using System;
using System.Globalization;
using System.Reflection;
using System.Timers;
using System.Windows.Threading;
@@ -53,6 +54,13 @@ namespace TestWindow
get { return true; }
}
public bool HasAboutMenu => true;
public void ShowAbout()
{
_floatingStatusWindow.SetText(Assembly.GetEntryAssembly().GetName().Version.ToString());
}
public void ShowSettings()
{