mirror of
https://github.com/ckaczor/FloatingStatusWindow.git
synced 2026-01-13 17:22:47 -05:00
Add support for an about menu
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -10,8 +10,10 @@ namespace FloatingStatusWindowLibrary
|
||||
|
||||
bool HasSettingsMenu { get; }
|
||||
bool HasRefreshMenu { get; }
|
||||
bool HasAboutMenu { get; }
|
||||
|
||||
void ShowSettings();
|
||||
void Refresh();
|
||||
void ShowAbout();
|
||||
}
|
||||
}
|
||||
|
||||
9
Library/Properties/Resources.Designer.cs
generated
9
Library/Properties/Resources.Designer.cs
generated
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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()
|
||||
{
|
||||
|
||||
|
||||
@@ -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()
|
||||
{
|
||||
|
||||
|
||||
@@ -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()
|
||||
{
|
||||
|
||||
|
||||
@@ -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()
|
||||
{
|
||||
|
||||
|
||||
Reference in New Issue
Block a user