Skip to content

Commit

Permalink
更新3.0版本
Browse files Browse the repository at this point in the history
  • Loading branch information
BluePointLilac committed Feb 21, 2021
1 parent 4577057 commit e4b6e85
Show file tree
Hide file tree
Showing 115 changed files with 5,044 additions and 2,086 deletions.
56 changes: 19 additions & 37 deletions ContextMenuManager/AppConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,18 @@
using System.IO;
using System.Runtime.InteropServices;
using System.Windows.Forms;
using BulePointLilac.Methods;
using BluePointLilac.Methods;

namespace ContextMenuManager
{
static class AppConfig
{
static AppConfig()
{
CreateDirs();
DeleteOldFiles();
foreach(string dirPath in new[] { ConfigDir, ProgramsDir, BackupDir, LangsDir, DicsDir, WebDicsDir, UserDicsDir })
{
Directory.CreateDirectory(dirPath);
}
}

[DllImport("kernel32.dll")]
Expand All @@ -25,6 +27,7 @@ static AppConfig()
public static string ConfigIni = $@"{ConfigDir}\Config.ini";
public static string BackupDir = $@"{ConfigDir}\Backup";
public static string LangsDir = $@"{ConfigDir}\Languages";
public static string ProgramsDir = $@"{ConfigDir}\Programs";
public static string DicsDir = $@"{ConfigDir}\Dictionaries";
public static string WebDicsDir = $@"{DicsDir}\Web";
public static string UserDicsDir = $@"{DicsDir}\User";
Expand All @@ -34,7 +37,7 @@ static AppConfig()
public static string UserThirdRulesDic = $@"{UserDicsDir}\{ThIRDRULESDICXML}";
public static string WebEnhanceMenusDic = $@"{WebDicsDir}\{ENHANCEMENUSICXML}";
public static string UserEnhanceMenusDic = $@"{UserDicsDir}\{ENHANCEMENUSICXML}";

public static string HashLnkExePath = $@"{ProgramsDir}\HashLnk.exe";
public const string ZH_CNINI = "zh-CN.ini";
public const string GUIDINFOSDICINI = "GuidInfosDic.ini";
public const string ThIRDRULESDICXML = "ThirdRulesDic.xml";
Expand Down Expand Up @@ -120,43 +123,22 @@ public static string EngineUrl
}
}

private static void CreateDirs()
public static bool ShowFilePath
{
foreach(string dirPath in new[] { ConfigDir, BackupDir, LangsDir, DicsDir, WebDicsDir, UserDicsDir })
{
Directory.CreateDirectory(dirPath);
}
get => ConfigWriter.GetValue("General", "ShowFilePath") == "1";
set => ConfigWriter.SetValue("General", "ShowFilePath", (value ? 1 : 0).ToString());
}

private static void DeleteOldFiles()
public static bool WinXSortable
{
DirectoryInfo configDi = new DirectoryInfo(ConfigDir);
foreach(DirectoryInfo di in configDi.GetDirectories())
{
bool isOther = true;
foreach(string path in new[] { BackupDir, LangsDir, DicsDir })
{
if(di.FullName.Equals(path, StringComparison.OrdinalIgnoreCase))
{
isOther = false;
break;
}
}
if(isOther) Directory.Delete(di.FullName);
}
foreach(FileInfo fi in configDi.GetFiles())
{
bool isOther = true;
foreach(string path in new[] { ConfigIni })
{
if(fi.FullName.Equals(path, StringComparison.OrdinalIgnoreCase))
{
isOther = false;
break;
}
}
if(isOther) File.Delete(fi.FullName);
}
get => ConfigWriter.GetValue("General", "WinXSortable") == "1";
set => ConfigWriter.SetValue("General", "WinXSortable", (value ? 1 : 0).ToString());
}

public static bool OpenMoreRegedit
{
get => ConfigWriter.GetValue("General", "OpenMoreRegedit") == "1";
set => ConfigWriter.SetValue("General", "OpenMoreRegedit", (value ? 1 : 0).ToString());
}
}
}
14 changes: 7 additions & 7 deletions ContextMenuManager/AppImage.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using BulePointLilac.Methods;
using BluePointLilac.Methods;
using ContextMenuManager.Properties;
using System.Drawing;

Expand Down Expand Up @@ -41,12 +41,12 @@ public static class AppImage
public static readonly Image Down = Up.RotateImage(RotateFlipType.Rotate180FlipNone);
///<summary>新建项目图标</summary>
public static readonly Image NewItem = Resources.NewItem.ResizeImage(Scale);
///<summary>分隔线图标</summary>
public static readonly Image Separator = Resources.SeparatorItem.ResizeImage(Scale);
///<summary>自定义类型图标</summary>
public static readonly Image CustomType = Resources.CustomType.ResizeImage(Scale);
///<summary>所有文件类型图标</summary>
public static readonly Image Types = Resources.Types.ResizeImage(Scale);
///<summary>新建文件夹图标</summary>
public static readonly Image NewFolder = Resources.NewFolder.ResizeImage(Scale);
///<summary>自定义图标</summary>
public static readonly Image Custom = Resources.Custom.ResizeImage(Scale);
///<summary>选择图标</summary>
public static readonly Image Select = Resources.Select.ResizeImage(Scale);
///<summary>Microsoft Store图标</summary>
public static readonly Image MicrosoftStore = Resources.MicrosoftStore.ResizeImage(Scale);
///<summary>Skype图标</summary>
Expand Down
78 changes: 48 additions & 30 deletions ContextMenuManager/AppString.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using BulePointLilac.Methods;
using BluePointLilac.Methods;
using System.Text;

namespace ContextMenuManager
Expand Down Expand Up @@ -55,20 +55,16 @@ public static class SideBar
public static string LnkFile => GetValue("LnkFile");
public static string UwpLnk => GetValue("UwpLnk");
public static string ExeFile => GetValue("ExeFile");
public static string TextFile => GetValue("TextFile");
public static string DocumentFile => GetValue("DocumentFile");
public static string ImageFile => GetValue("ImageFile");
public static string VideoFile => GetValue("VideoFile");
public static string AudioFile => GetValue("AudioFile");
public static string ImageDirectory => GetValue("ImageDirectory");
public static string VideoDirectory => GetValue("VideoDirectory");
public static string AudioDirectory => GetValue("AudioDirectory");
public static string UnknownType => GetValue("UnknownType");
public static string CustomType => GetValue("CustomType");
public static string CustomExtension => GetValue("CustomExtension");
public static string PerceivedType => GetValue("PerceivedType");
public static string DirectoryType => GetValue("DirectoryType");
public static string EnhanceMenu => GetValue("EnhanceMenu");
public static string ThirdRules => GetValue("ThirdRules");
public static string GuidBlocked => GetValue("GuidBlocked");
public static string DragDrop => GetValue("DragDrop");
public static string PublicReferences => GetValue("PublicReferences");
public static string IEMenu => GetValue("IEMenu");
public static string AppSetting => GetValue("AppSetting");
public static string AboutApp => GetValue("AboutApp");
public static string Dictionaries => GetValue("Dictionaries");
Expand Down Expand Up @@ -97,23 +93,19 @@ public static class StatusBar
public static string LnkFile => GetValue("LnkFile");
public static string UwpLnk => GetValue("UwpLnk");
public static string ExeFile => GetValue("ExeFile");
public static string TextFile => GetValue("TextFile");
public static string DocumentFile => GetValue("DocumentFile");
public static string ImageFile => GetValue("ImageFile");
public static string VideoFile => GetValue("VideoFile");
public static string AudioFile => GetValue("AudioFile");
public static string ImageDirectory => GetValue("ImageDirectory");
public static string VideoDirectory => GetValue("VideoDirectory");
public static string AudioDirectory => GetValue("AudioDirectory");
public static string UnknownType => GetValue("UnknownType");
public static string CustomType => GetValue("CustomType");
public static string CustomExtension => GetValue("CustomExtension");
public static string PerceivedType => GetValue("PerceivedType");
public static string DirectoryType => GetValue("DirectoryType");
public static string EnhanceMenu => GetValue("EnhanceMenu");
public static string ThirdRules => GetValue("ThirdRules");
public static string GuidBlocked => GetValue("GuidBlocked");
public static string DragDrop => GetValue("DragDrop");
public static string PublicReferences => GetValue("PublicReferences");
public static string IEMenu => GetValue("IEMenu");
}

/// <summary>菜单</summary>
/// <summary>程序内右键菜单</summary>
public static class Menu
{
private static string GetValue(string key) => GetStringValue("Menu", key);
Expand All @@ -132,9 +124,11 @@ public static class Menu
public static string OnlyInExplorer => GetValue("OnlyInExplorer");
public static string NoWorkingDirectory => GetValue("NoWorkingDirectory");
public static string NeverDefault => GetValue("NeverDefault");
public static string ShowAsDisabledIfHidden => GetValue("ShowAsDisabledIfHidden");
public static string Details => GetValue("Details");
public static string WebSearch => GetValue("WebSearch");
public static string ChangeCommand => GetValue("ChangeCommand");
public static string RunAsAdministrator => GetValue("RunAsAdministrator");
public static string FileProperties => GetValue("FileProperties");
public static string FileLocation => GetValue("FileLocation");
public static string RegistryLocation => GetValue("RegistryLocation");
Expand All @@ -146,6 +140,9 @@ public static class Menu
public static string BlockGuid => GetValue("BlockGuid");
public static string AddGuidDic => GetValue("AddGuidDic");
public static string InitialData => GetValue("InitialData");
public static string BeforeSeparator => GetValue("BeforeSeparator");
public static string ChangeGroup => GetValue("ChangeGroup");
public static string RestoreDefault => GetValue("RestoreDefault");
public static string Edit => GetValue("Edit");
public static string Save => GetValue("Save");
}
Expand All @@ -172,12 +169,19 @@ public static class Item
public static string ShareWithSkype => GetValue("ShareWithSkype");
public static string NewItem => GetValue("NewItem");
public static string AddGuidBlockedItem => GetValue("AddGuidBlockedItem");
public static string SelectExtension => GetValue("SelectExtension");
public static string SelectPerceivedType => GetValue("SelectPerceivedType");
public static string SelectDirectoryType => GetValue("SelectDirectoryType");
public static string CurrentExtension => GetValue("CurrentExtension");
public static string SetPerceivedType => GetValue("SetPerceivedType");
public static string CurrentPerceivedType => GetValue("CurrentPerceivedType");
public static string CurrentDirectoryType => GetValue("CurrentDirectoryType");
public static string EditSubItems => GetValue("EditSubItems");
public static string InvalidItem => GetValue("InvalidItem");
public static string Separator => GetValue("Separator");
public static string LockNewMenu => GetValue("LockNewMenu");
public static string WinXSortable => GetValue("WinXSortable");
public static string ShowFilePath => GetValue("ShowFilePath");
public static string OpenMoreRegedit => GetValue("OpenMoreRegedit");
}

public static class Dialog
Expand All @@ -187,9 +191,6 @@ public static class Dialog
public static string Cancel => GetValue("Cancel");
public static string Browse => GetValue("Browse");
public static string Program => GetValue("Program");
public static string NewShellItem => GetValue("NewShellItem");
public static string NewSendToItem => GetValue("NewSendToItem");
public static string NewOpenWithItem => GetValue("NewOpenWithItem");
public static string ItemText => GetValue("ItemText");
public static string ItemCommand => GetValue("ItemCommand");
public static string CommandArguments => GetValue("CommandArguments");
Expand All @@ -199,14 +200,26 @@ public static class Dialog
public static string MultiMenu => GetValue("MultiMenu");
public static string Public => GetValue("Public");
public static string Private => GetValue("Private");
public static string Administrator => GetValue("Administrator");
public static string InputGuid => GetValue("InputGuid");
public static string AddGuidDic => GetValue("AddGuidDic");
public static string DeleteGuidDic => GetValue("DeleteGuidDic");
public static string SelectExtension => GetValue("SelectExtension");
public static string TextFile => GetValue("TextFile");
public static string DocumentFile => GetValue("DocumentFile");
public static string ImageFile => GetValue("ImageFile");
public static string VideoFile => GetValue("VideoFile");
public static string AudioFile => GetValue("AudioFile");
public static string CompressedFile => GetValue("CompressedFile");
public static string SystemFile => GetValue("SystemFile");
public static string DocumentDirectory => GetValue("DocumentDirectory");
public static string ImageDirectory => GetValue("ImageDirectory");
public static string VideoDirectory => GetValue("VideoDirectory");
public static string AudioDirectory => GetValue("AudioDirectory");
public static string CheckReference => GetValue("CheckReference");
public static string CheckCopy => GetValue("CheckCopy");
public static string SelectSubMenuMode => GetValue("SelectSubMenuMode");
public static string RegistryFile => GetValue("RegistryFile");
public static string SelectGroup => GetValue("SelectGroup");
}

/// <summary>消息框</summary>
Expand All @@ -218,6 +231,7 @@ public static class MessageBox
public static string StringParsingFailed => GetValue("StringParsingFailed");
public static string TextLengthCannotExceed80 => GetValue("TextLengthCannotExceed80");
public static string ConfirmDeletePermanently => GetValue("ConfirmDeletePermanently");
public static string DeleteButCanRestore => GetValue("DeleteButCanRestore");
public static string ConfirmDeleteReference => GetValue("ConfirmDeleteReference");
public static string ConfirmDelete => GetValue("ConfirmDelete");
public static string ConfirmDeleteReferenced => GetValue("ConfirmDeleteReferenced");
Expand All @@ -238,6 +252,9 @@ public static class MessageBox
public static string FolderNotExists => GetValue("FolderNotExists");
public static string NoUpdateDetected => GetValue("NoUpdateDetected");
public static string AuthorityProtection => GetValue("AuthorityProtection");
public static string WinXSorted => GetValue("WinXSorted");
public static string RestoreDefault => GetValue("RestoreDefault");
public static string DeleteGroup => GetValue("DeleteGroup");
}

/// <summary>其他文本</summary>
Expand All @@ -257,9 +274,9 @@ public static class Other
public static string Dictionaries => GetValue("Dictionaries");
public static string Donate => GetValue("Donate");
public static string DonationList => GetValue("DonationList");
public static string ConfigFile => GetValue("ConfigFile");
public static string SaveToAppData => GetValue("SaveToAppData");
public static string SaveToAppDir => GetValue("SaveToAppDir");
public static string ConfigPath => GetValue("ConfigPath");
public static string AppDataDir => GetValue("AppDataDir");
public static string AppDir => GetValue("AppDir");
public static string OpenConfigDir => GetValue("OpenConfigDir");
public static string AutoBackup => GetValue("AutoBackup");
public static string OpenBackupDir => GetValue("OpenBackupDir");
Expand All @@ -282,7 +299,6 @@ public static class Tip
public static string EditSubItems => GetValue("EditSubItems");
public static string InvalidItem => GetValue("InvalidItem");
public static string AddSeparator => GetValue("AddSeparator");
public static string Separator => GetValue("Separator");
public static string AddReference => GetValue("AddReference");
public static string AddFromParentMenu => GetValue("AddFromParentMenu");
public static string DeleteGuidDic => GetValue("DeleteGuidDic");
Expand All @@ -291,7 +307,9 @@ public static class Tip
public static string LastCheckUpdateTime => GetValue("LastCheckUpdateTime");
public static string OpenLanguagesDir => GetValue("OpenLanguagesDir");
public static string OpenDictionariesDir => GetValue("OpenDictionariesDir");
public static string ShareWithSkype => GetValue("ShareWithSkype");
public static string ConfigPath => GetValue("ConfigPath");
public static string CommandFiles => GetValue("CommandFiles");
public static string CreateGroup => GetValue("CreateGroup");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using System.Text;
using System.Windows.Forms;

namespace BulePointLilac.Controls
namespace BluePointLilac.Controls
{
public sealed class IconDialog : CommonDialog
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using BulePointLilac.Methods;
using BluePointLilac.Methods;
using ContextMenuManager;
using System;
using System.Drawing;
using System.Windows.Forms;

namespace BulePointLilac.Controls
namespace BluePointLilac.Controls
{
public sealed class InputDialog : CommonDialog
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using ContextMenuManager;
using System.Windows.Forms;

namespace BulePointLilac.Controls
namespace BluePointLilac.Controls
{
public class MyCheckBox : PictureBox
{
Expand All @@ -18,6 +18,7 @@ public bool Checked

public MyCheckBox()
{
this.Checked = false;
this.Cursor = Cursors.Hand;
this.SizeMode = PictureBoxSizeMode.AutoSize;
}
Expand Down
Loading

0 comments on commit e4b6e85

Please sign in to comment.