From 2c74c0b9f4d4002705c2c904ef2dffe81721bc8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=93=9D=E7=82=B9lilac?= Date: Sat, 26 Dec 2020 12:33:40 +0800 Subject: [PATCH] --- ContextMenuManager/Controls/LockNewItem.cs | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/ContextMenuManager/Controls/LockNewItem.cs b/ContextMenuManager/Controls/LockNewItem.cs index 4a52c58..0857c4b 100644 --- a/ContextMenuManager/Controls/LockNewItem.cs +++ b/ContextMenuManager/Controls/LockNewItem.cs @@ -9,7 +9,7 @@ using System.Windows.Forms; namespace ContextMenuManager.Controls { - sealed class LockNewItem : MyListItem, IChkVisibleItem + sealed class LockNewItem : MyListItem, IChkVisibleItem, IBtnShowMenuItem, ITsiWebSearchItem { public LockNewItem(ShellNewList list) { @@ -17,14 +17,16 @@ namespace ContextMenuManager.Controls this.Image = AppImage.Lock; this.Text = AppString.Item.LockNewMenu; this.SetNoClickEvent(); - ChkVisible = new VisibleCheckBox(this) - { - Margin = new Padding(Margin.Left, Margin.Top, RegRuleItem.SysMarginRignt, Margin.Bottom), - Checked = IsLocked() - }; + BtnShowMenu = new MenuButton(this); + ChkVisible = new VisibleCheckBox(this) { Checked = IsLocked() }; MyToolTip.SetToolTip(ChkVisible, AppString.Tip.LockNewMenu); + TsiSearch = new WebSearchMenuItem(this); + this.ContextMenuStrip = new ContextMenuStrip(); + this.ContextMenuStrip.Items.Add(TsiSearch); } + public MenuButton BtnShowMenu { get; set; } + public WebSearchMenuItem TsiSearch { get; set; } public VisibleCheckBox ChkVisible { get; set; } public ShellNewList Owner { get; private set; } @@ -49,6 +51,9 @@ namespace ContextMenuManager.Controls } } + public string SearchText => Text; + + public static bool IsLocked() { using(RegistryKey key = RegistryEx.GetRegistryKey(ShellNewList.ShellNewPath))