Esempio n. 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");
 }
Esempio n. 2
0
        private void GenProfList()
        {
            refreshing = true;
            Settings.LoadSettings();
            profileBox.Items.Clear();
            DirectoryInfo di = new DirectoryInfo("./DiceData");

            foreach (FileInfo prof in di.EnumerateFiles())
            {
                profileBox.Items.Add(prof.Name.Remove(prof.Name.Length - 4, 4));
            }
            profileBox.SelectedItem = Settings.Data.ProfileName;
            refreshing = false;
        }
Esempio n. 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();
        }
Esempio n. 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();
     }
 }