mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-06 19:26:39 +02:00
Remove redundant code
1. remove this 2. auto property should be only 1 line 3. misc 4. part of refactoring for PR #494
This commit is contained in:
@@ -17,22 +17,22 @@ namespace Wox
|
||||
|
||||
public NotifyIconManager(IPublicAPI api)
|
||||
{
|
||||
this.InitialTray();
|
||||
this._api = api;
|
||||
InitialTray();
|
||||
_api = api;
|
||||
}
|
||||
|
||||
private void InitialTray()
|
||||
{
|
||||
notifyIcon = new NotifyIcon { Text = "Wox", Icon = Properties.Resources.app, Visible = true };
|
||||
notifyIcon.Click += (o, e) => this._api.ShowApp();
|
||||
notifyIcon.Click += (o, e) => _api.ShowApp();
|
||||
var open = new MenuItem(InternationalizationManager.Instance.GetTranslation("iconTrayOpen"));
|
||||
open.Click += (o, e) => this._api.ShowApp();
|
||||
open.Click += (o, e) => _api.ShowApp();
|
||||
var setting = new MenuItem(InternationalizationManager.Instance.GetTranslation("iconTraySettings"));
|
||||
setting.Click += (o, e) => this._api.OpenSettingDialog();
|
||||
setting.Click += (o, e) => _api.OpenSettingDialog();
|
||||
var about = new MenuItem(InternationalizationManager.Instance.GetTranslation("iconTrayAbout"));
|
||||
about.Click += (o, e) => this._api.OpenSettingDialog("about");
|
||||
about.Click += (o, e) => _api.OpenSettingDialog("about");
|
||||
var exit = new MenuItem(InternationalizationManager.Instance.GetTranslation("iconTrayExit"));
|
||||
exit.Click += (o, e) => this._api.CloseApp();
|
||||
exit.Click += (o, e) => _api.CloseApp();
|
||||
MenuItem[] childen = { open, setting, about, exit };
|
||||
notifyIcon.ContextMenu = new ContextMenu(childen);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user