Skip to content

Commit 9fde37f

Browse files
更新3.1版本
1 parent 108dba4 commit 9fde37f

File tree

12 files changed

+76
-31
lines changed

12 files changed

+76
-31
lines changed

ContextMenuManager/AppConfig.cs

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public static string Language
7878
public static bool AutoBackup
7979
{
8080
get => ConfigWriter.GetValue("General", "AutoBackup") != "0";
81-
set => ConfigWriter.SetValue("General", "AutoBackup", (value ? 1 : 0).ToString());
81+
set => ConfigWriter.SetValue("General", "AutoBackup", value ? 1 : 0);
8282
}
8383

8484
public static DateTime LastCheckUpdateTime
@@ -99,14 +99,14 @@ public static DateTime LastCheckUpdateTime
9999
}
100100
set
101101
{
102-
ConfigWriter.SetValue("General", "LastCheckUpdateTime", value.ToBinary().ToString());
102+
ConfigWriter.SetValue("General", "LastCheckUpdateTime", value.ToBinary());
103103
}
104104
}
105105

106106
public static bool ProtectOpenItem
107107
{
108108
get => ConfigWriter.GetValue("General", "ProtectOpenItem") != "0";
109-
set => ConfigWriter.SetValue("General", "ProtectOpenItem", (value ? 1 : 0).ToString());
109+
set => ConfigWriter.SetValue("General", "ProtectOpenItem", value ? 1 : 0);
110110
}
111111

112112
public static string EngineUrl
@@ -126,19 +126,34 @@ public static string EngineUrl
126126
public static bool ShowFilePath
127127
{
128128
get => ConfigWriter.GetValue("General", "ShowFilePath") == "1";
129-
set => ConfigWriter.SetValue("General", "ShowFilePath", (value ? 1 : 0).ToString());
129+
set => ConfigWriter.SetValue("General", "ShowFilePath", value ? 1 : 0);
130130
}
131131

132132
public static bool WinXSortable
133133
{
134134
get => ConfigWriter.GetValue("General", "WinXSortable") == "1";
135-
set => ConfigWriter.SetValue("General", "WinXSortable", (value ? 1 : 0).ToString());
135+
set => ConfigWriter.SetValue("General", "WinXSortable", value ? 1 : 0);
136136
}
137137

138138
public static bool OpenMoreRegedit
139139
{
140140
get => ConfigWriter.GetValue("General", "OpenMoreRegedit") == "1";
141-
set => ConfigWriter.SetValue("General", "OpenMoreRegedit", (value ? 1 : 0).ToString());
141+
set => ConfigWriter.SetValue("General", "OpenMoreRegedit", value ? 1 : 0);
142+
}
143+
144+
public static Version Version
145+
{
146+
get
147+
{
148+
Version version = new Version();
149+
try { version = new Version(ConfigWriter.GetValue("General", "Version")); }
150+
catch { }
151+
return version;
152+
}
153+
set
154+
{
155+
ConfigWriter.SetValue("General", "Version", value);
156+
}
142157
}
143158
}
144159
}

ContextMenuManager/BluePointLilac.Methods/ExternalProgram.cs

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using System;
1+
using Microsoft.Win32;
2+
using System;
23
using System.Diagnostics;
34
using System.IO;
45
using System.Runtime.InteropServices;
@@ -36,19 +37,24 @@ public static void JumpRegEdit(string regPath, string valueName = null, bool mor
3637
Thread.Sleep(50);
3738
SendMessage(hTree, WM_KEYDOWN, VK_RIGHT, null);
3839
}
39-
else SendMessage(hTree, WM_CHAR, Convert.ToInt16(chr), null);
40+
else
41+
{
42+
SendMessage(hTree, WM_CHAR, Convert.ToInt16(chr), null);
43+
}
4044
}
4145

42-
if(!string.IsNullOrEmpty(valueName))
46+
if(string.IsNullOrEmpty(valueName)) return;
47+
using(RegistryKey key = RegistryEx.GetRegistryKey(regPath))
4348
{
44-
Thread.Sleep(50);
45-
SetForegroundWindow(hList);
46-
SetFocus(hList);
47-
SendMessage(hList, WM_KEYDOWN, VK_HOME, null);
48-
foreach(char chr in Encoding.Default.GetBytes(valueName))
49-
{
50-
SendMessage(hList, WM_CHAR, Convert.ToInt16(chr), null);
51-
}
49+
if(key?.GetValue(valueName) == null) return;
50+
}
51+
Thread.Sleep(50);
52+
SetForegroundWindow(hList);
53+
SetFocus(hList);
54+
SendMessage(hList, WM_KEYDOWN, VK_HOME, null);
55+
foreach(char chr in Encoding.Default.GetBytes(valueName))
56+
{
57+
SendMessage(hList, WM_CHAR, Convert.ToInt16(chr), null);
5258
}
5359
}
5460

@@ -118,7 +124,7 @@ public static void OpenNotepadWithText(string text)
118124
{
119125
using(Process process = Process.Start("notepad.exe"))
120126
{
121-
Thread.Sleep(200);
127+
process.WaitForInputIdle();
122128
IntPtr handle = FindWindowEx(process.MainWindowHandle, IntPtr.Zero, "Edit", null);
123129
SendMessage(handle, WM_SETTEXT, 0, text);
124130
}

ContextMenuManager/BluePointLilac.Methods/GuidEx.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,14 @@ public static bool TryParse(string str, out Guid guid)
2020
}
2121
}
2222

23+
private static readonly Regex GuidRegex = new Regex(@"[A-F0-9]{8}(\-[A-F0-9]{4}){3}\-[A-F0-9]{12}", RegexOptions.IgnoreCase);
24+
2325
public static bool IsGuid(string str)
2426
{
2527
if(string.IsNullOrEmpty(str)) return false;
26-
Regex guidRegEx = new Regex(@"[a-fA-F0-9]{8}(\-[a-fA-F0-9]{4}){3}\-[a-fA-F0-9]{12}");
27-
return guidRegEx.IsMatch(str);
28+
if(str.Length == 38 && str.StartsWith("{") && str.EndsWith("}") && GuidRegex.IsMatch(str)) return true;
29+
if(str.Length == 36 && GuidRegex.IsMatch(str)) return true;
30+
return false;
2831
}
2932
}
3033
}

ContextMenuManager/BluePointLilac.Methods/IniWriter.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,11 @@ private void SetValue(string section, string key, ref string value, bool isGetVa
152152
}
153153
}
154154

155+
public void SetValue(string section, string key, object value)
156+
{
157+
SetValue(section, key, value.ToString());
158+
}
159+
155160
public void SetValue(string section, string key, string value)
156161
{
157162
SetValue(section, key, ref value, false);

ContextMenuManager/Controls/AboutApp.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ public AppSettingBox()
279279
MyToolTip.SetToolTip(cmbConfigDir, AppString.Tip.ConfigPath);
280280
MyToolTip.SetToolTip(btnConfigDir, AppString.Other.OpenConfigDir);
281281
MyToolTip.SetToolTip(btnBackupDir, AppString.Other.OpenBackupDir);
282-
MyToolTip.SetToolTip(lblUpdate, AppString.Tip.CheckUpdate + Environment.NewLine
282+
MyToolTip.SetToolTip(mliUpdate, AppString.Tip.CheckUpdate + Environment.NewLine
283283
+ AppString.Tip.LastCheckUpdateTime + AppConfig.LastCheckUpdateTime.ToLongDateString());
284284
cmbConfigDir.Items.AddRange(new[] { AppString.Other.AppDataDir, AppString.Other.AppDir });
285285
cmbEngine.Items.AddRange(new[] { "Baidu", "Bing", "Google", "DogeDoge", "Sogou", "360", AppString.Other.CustomEngine });

ContextMenuManager/Controls/RuleItem.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ public int ItemValue
444444
}
445445
set
446446
{
447-
IniWriter.SetValue(Rule.Section, Rule.KeyName, value.ToString());
447+
IniWriter.SetValue(Rule.Section, Rule.KeyName, value);
448448
}
449449
}
450450
}

ContextMenuManager/Controls/ShellExItem.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public string RegPath
5959
}
6060
}
6161

62-
public string ValueName => DefaultValue;
62+
public string ValueName => null;
6363
public Guid Guid { get; set; }
6464
public string SearchText => Text;
6565
public string ItemFilePath => GuidInfo.GetFilePath(Guid);

ContextMenuManager/Controls/ShellExecuteDialog.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ public ShellExecuteCheckBox()
131131
{
132132
this.Text = "ShellExecute";
133133
this.AutoSize = true;
134-
this.Font = new Font(SystemFonts.DialogFont.FontFamily, 8F);
134+
this.Font = new Font(SystemFonts.DialogFont.FontFamily, 8F / 1F.DpiZoom());
135135
}
136136

137137
public string Verb { get; set; }

ContextMenuManager/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@
1111
[assembly: AssemblyCulture("")]
1212
[assembly: ComVisible(false)]
1313
[assembly: Guid("35190ec1-2515-488d-a2e9-825d6ff67aa2")]
14-
[assembly: AssemblyVersion("3.0.0.0")]
15-
[assembly: AssemblyFileVersion("3.0.0.0")]
14+
[assembly: AssemblyVersion("3.1.0.0")]
15+
[assembly: AssemblyFileVersion("3.1.0.0")]

ContextMenuManager/Properties/Resources/Texts/GuidInfosDic.ini

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,8 @@ Icon=..\FreeArc.exe
241241
[AD392E40-428C-459F-961E-9B147782D099]
242242
Text=UltraISO
243243
Icon=.\UltraISO.exe
244+
[be86f80b-eb1a-45b4-b4b6-4b12d302b6bc]
245+
Text=AntZip
244246

245247
;----------------杀软------------------
246248
[09A47860-11B0-4DA5-AFA5-26D86198A780]
@@ -316,6 +318,7 @@ Text=使用瑞星杀毒
316318
[0bb81440-5f42-4480-a5f7-770a6f439fc8]
317319
Text=IObit Malware Fighter
318320
Icon=*,3
321+
319322
;----------------传输------------------
320323
[53D2405C-48AB-4C8A-8F59-CE0610F13BBC]
321324
Text=通过QQ发送到

0 commit comments

Comments
 (0)