Пример #1
0
 void LoadSettings()
 {
     if (File.Exists(settingsFile))
     {
         using (var sr = new StreamReader(settingsFile))
         {
             var s = new Deserializer();
             VM = s.Deserialize<BuffetVM>(sr);
         }
     }
     else
     { 
         VM = new BuffetVM();
         foreach (var effect in Effects.AllEffects())
             VM.SoundSettings.Add(new SoundSettingsVM() { BuffName = effect.name, PlayBuffEndedSound = true, PlayBuffGrantedSound = true });
     }
 }
Пример #2
0
        public void DeInitPlugin()
        {
            AppDomain.CurrentDomain.AssemblyResolve -= AppDomain_AssemblyResolve;
            // Unsubscribe from any events you listen to when exiting!
            //ActGlobals.oFormActMain.AfterCombatAction -= oFormActMain_AfterCombatAction;
            ActGlobals.oFormActMain.OnLogLineRead -= oFormActMain_OnLogLineRead;

            logWriter.Flush();
            logWriter.Close();

            Properties.Settings.Default.Save();
            SaveSettings();

            VM = null;

            display.Close();
            display = null;

            lblStatus.Text = "Plugin Exited";
        }