* UINavMenu,UINavBar:增加了一个函数ClearAll
This commit is contained in:
parent
8b5f35588c
commit
89c97f2938
BIN
Bin/SunnyUI.dll
BIN
Bin/SunnyUI.dll
Binary file not shown.
@ -56,6 +56,12 @@ namespace Sunny.UI
|
|||||||
Version = UIGlobal.Version;
|
Version = UIGlobal.Version;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void ClearAll()
|
||||||
|
{
|
||||||
|
Nodes.Clear();
|
||||||
|
MenuHelper.Clear();
|
||||||
|
}
|
||||||
|
|
||||||
protected override void OnFontChanged(EventArgs e)
|
protected override void OnFontChanged(EventArgs e)
|
||||||
{
|
{
|
||||||
base.OnFontChanged(e);
|
base.OnFontChanged(e);
|
||||||
|
@ -87,6 +87,12 @@ namespace Sunny.UI
|
|||||||
[Description("获取或设置包含有关控件的数据的对象字符串"), Category("SunnyUI")]
|
[Description("获取或设置包含有关控件的数据的对象字符串"), Category("SunnyUI")]
|
||||||
public string TagString { get; set; }
|
public string TagString { get; set; }
|
||||||
|
|
||||||
|
public void ClearAll()
|
||||||
|
{
|
||||||
|
Nodes.Clear();
|
||||||
|
MenuHelper.Clear();
|
||||||
|
}
|
||||||
|
|
||||||
protected override void OnBackColorChanged(EventArgs e)
|
protected override void OnBackColorChanged(EventArgs e)
|
||||||
{
|
{
|
||||||
base.OnBackColorChanged(e);
|
base.OnBackColorChanged(e);
|
||||||
|
@ -41,6 +41,11 @@ namespace Sunny.UI
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void Clear()
|
||||||
|
{
|
||||||
|
Items.Clear();
|
||||||
|
}
|
||||||
|
|
||||||
private readonly ConcurrentDictionary<TreeNode, NavMenuItem> Items = new ConcurrentDictionary<TreeNode, NavMenuItem>();
|
private readonly ConcurrentDictionary<TreeNode, NavMenuItem> Items = new ConcurrentDictionary<TreeNode, NavMenuItem>();
|
||||||
|
|
||||||
public string GetTipsText(TreeNode node)
|
public string GetTipsText(TreeNode node)
|
||||||
|
@ -51,19 +51,32 @@ namespace Sunny.UI
|
|||||||
|
|
||||||
public static void EnabledTaskManager()
|
public static void EnabledTaskManager()
|
||||||
{
|
{
|
||||||
DisableTaskMgrRegistryKey(true);
|
RegistryDisableTaskMgr(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void DisabledTaskManager()
|
public static void DisabledTaskManager()
|
||||||
{
|
{
|
||||||
DisableTaskMgrRegistryKey(false);
|
RegistryDisableTaskMgr(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void DisableTaskMgrRegistryKey(bool enabled)
|
public static void RegistryDisableTaskMgr(int value)
|
||||||
{
|
{
|
||||||
string subKey = "Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System";
|
string subKey = "Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System";
|
||||||
RegistryKey mKey = Registry.CurrentUser.CreateSubKey(subKey);
|
RegistryKey mKey = Registry.CurrentUser.CreateSubKey(subKey);
|
||||||
mKey?.SetValue("DisableTaskMgr", enabled ? 0 : 1);
|
mKey?.SetValue("DisableTaskMgr", value);
|
||||||
|
mKey?.Dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void RegistryHooksTimeout()
|
||||||
|
{
|
||||||
|
string subKey = @"Control Panel\Desktop";
|
||||||
|
RegistryKey mKey = Registry.CurrentUser.CreateSubKey(subKey);
|
||||||
|
mKey?.SetValue("LowLevelHooksTimeout", 10000);
|
||||||
|
mKey?.Dispose();
|
||||||
|
|
||||||
|
subKey = @".DEFAULT\Control Panel\Desktop";
|
||||||
|
mKey = Registry.Users.CreateSubKey(subKey);
|
||||||
|
mKey?.SetValue("LowLevelHooksTimeout", 10000);
|
||||||
mKey?.Dispose();
|
mKey?.Dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user