Loading src/WatermarkClock/ConfigManager.cs +9 −0 Original line number Diff line number Diff line Loading @@ -35,6 +35,15 @@ namespace WatermarkClock return GetDefaultConfigPath(); } /// <summary> /// 检查命令行参数是否包含 --no-config 或 -n /// </summary> public static bool IsNoConfigMode() { var args = Environment.GetCommandLineArgs(); return args.Any(a => a == "--no-config" || a == "-n"); } /// <summary> /// 加载配置文件,若不存在则返回默认配置并写入文件 /// </summary> Loading src/WatermarkClock/MainWindow.xaml.cs +6 −0 Original line number Diff line number Diff line Loading @@ -35,6 +35,12 @@ namespace WatermarkClock DgTemplates.ItemsSource = _ctx.Templates; _notifyIcon = new NotifyIconWrapper(this); ApplySettings(); // 如果指定了 --no-config / -n 参数,启动后隐藏到托盘 if (ConfigManager.IsNoConfigMode()) { Loaded += (s, e) => Hide(); } } private void InitComboBox() Loading src/WatermarkClock/WatermarkClock.csproj +7 −0 Original line number Diff line number Diff line Loading @@ -2,6 +2,13 @@ <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')"/> <PropertyGroup> <Authors>shRabbit</Authors> <Company>shRabbit</Company> <Version>1.0</Version> </PropertyGroup> <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> Loading Loading
src/WatermarkClock/ConfigManager.cs +9 −0 Original line number Diff line number Diff line Loading @@ -35,6 +35,15 @@ namespace WatermarkClock return GetDefaultConfigPath(); } /// <summary> /// 检查命令行参数是否包含 --no-config 或 -n /// </summary> public static bool IsNoConfigMode() { var args = Environment.GetCommandLineArgs(); return args.Any(a => a == "--no-config" || a == "-n"); } /// <summary> /// 加载配置文件,若不存在则返回默认配置并写入文件 /// </summary> Loading
src/WatermarkClock/MainWindow.xaml.cs +6 −0 Original line number Diff line number Diff line Loading @@ -35,6 +35,12 @@ namespace WatermarkClock DgTemplates.ItemsSource = _ctx.Templates; _notifyIcon = new NotifyIconWrapper(this); ApplySettings(); // 如果指定了 --no-config / -n 参数,启动后隐藏到托盘 if (ConfigManager.IsNoConfigMode()) { Loaded += (s, e) => Hide(); } } private void InitComboBox() Loading
src/WatermarkClock/WatermarkClock.csproj +7 −0 Original line number Diff line number Diff line Loading @@ -2,6 +2,13 @@ <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')"/> <PropertyGroup> <Authors>shRabbit</Authors> <Company>shRabbit</Company> <Version>1.0</Version> </PropertyGroup> <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> Loading