Преглед на файлове

Use exe name to decide settings path

This means that if you have multiple exes in the same folder, they'll each have their own settings. This is the official way of having more than one clock.
Daniel Chalmers преди 2 години
родител
ревизия
c47b9d1009
променени са 1 файла, в които са добавени 1 реда и са изтрити 1 реда
  1. 1 1
      DesktopClock/Properties/Settings.cs

+ 1 - 1
DesktopClock/Properties/Settings.cs

@@ -11,7 +11,7 @@ public sealed class Settings : INotifyPropertyChanged
 {
     private DateTime _fileLastUsed = DateTime.UtcNow;
 
-    public static readonly string Path = "DesktopClock.settings";
+    public static readonly string Path = System.Diagnostics.Process.GetCurrentProcess().ProcessName + ".settings";
     private static readonly Lazy<Settings> _default = new(() => TryLoad() ?? new Settings());
 
     private static readonly JsonSerializerSettings _jsonSerializerSettings = new()