Beispiel #1
0
        public override bool RunService(FormMain main)
        {
            if (File.Exists(PLUGIN_SETTINGS))
                settings = DynamicJson.Parse(File.ReadAllText(PLUGIN_SETTINGS)).Deserialize<Settings>();
            else
                settings = new Settings();

            Task.Factory.StartNew(() => FatigueObserver.Instance.Initialize(main, this));

            return true;
        }
Beispiel #2
0
 public void SaveSettings()
 {
     if (settings == null)
     {
         settings = new Settings();
     }
     if (!Directory.Exists("Settings"))
     {
         Directory.CreateDirectory("Settings");
     }
     File.WriteAllText(PLUGIN_SETTINGS, DynamicJson.Serialize(settings));
 }