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"); }
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()"); }
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(); }
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(); } }