Exemple #1
0
 private void ReloadSettings()
 {
     Settings.LoadSettings();
     Saver = new DiceSaver(Settings.Data.ProfileName);
     Saver.LoadFile(ref DiceData);
     this.Title = "D&D Dicer (" + Settings.Data.ProfileName + ")";
     App.Log.WriteDebug("Settings reloaded");
 }
Exemple #2
0
 public MainWindow()
 {
     App.Log.maxLogLevel = vLogger.LogLevel.Debug;
     App.Log.WriteLog("MainWindow initialized at " + DateTime.Now.ToString(), vLogger.LogLevel.Error);
     InitializeComponent();
     Settings = new DicerSettings();
     App.Log.WriteDebug("Initialized Settings variable");
     Saver = new DiceSaver(Settings.Data.ProfileName);
     App.Log.WriteDebug("Initialized Saver variable");
     Saver.LoadFile(ref DiceData);
     App.Log.WriteDebug("Save.LoadFile()");
 }
Exemple #3
0
        private void okBtn_Click(object sender, RoutedEventArgs e)
        {
            Dice      tDice  = new Dice();
            DiceSaver tSaver = new DiceSaver(profTxt.Text);

            tSaver.LoadFile(ref tDice);
            tSaver.SaveFile(tDice);
            DicerSettings set = new DicerSettings();

            set.LoadSettings();
            set.Data.ProfileName = profTxt.Text;
            set.SaveSettings();
            this.Close();
        }
Exemple #4
0
 private void profTxt_KeyUp(object sender, KeyEventArgs e)
 {
     if (e.Key == Key.Enter)
     {
         Dice      tDice  = new Dice();
         DiceSaver tSaver = new DiceSaver(profTxt.Text);
         tSaver.LoadFile(ref tDice);
         tSaver.SaveFile(tDice);
         DicerSettings set = new DicerSettings();
         set.LoadSettings();
         set.Data.ProfileName = profTxt.Text;
         set.SaveSettings();
         this.Close();
     }
 }