static App() { DispatcherHelper.Initialize(); string lang = MainSettings.LoadFromXML().Language; System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(lang); }
private void SetCurrentView(ViewModelBase vm) { if (vm is GameViewModel) { } else if (vm is SettingsViewModel) { MessengerInstance.Send <MainSettings>(MainSettings.LoadFromXML(), Tokens.OpenSettings); } CurrentViewModel = vm; }
public void GetMainSettings(Action <MainSettings, Exception> callback) { try { MainSettings settings = MainSettings.LoadFromXML(); callback(settings, null); } catch (Exception ex) { callback(null, ex); } }
public void TestSaveToXml() { MainSettings settings = new MainSettings(); settings.GameAreaSize = 10; settings.InRowToWin = 10; settings.Language = "pl"; settings.SaveToXML("TestConfig\\Settings.xml"); settings = MainSettings.LoadFromXML("TestConfig\\Settings.xml"); Assert.AreEqual(settings.InRowToWin, 10); }
public void TestLoadFromXMLDefaultValues() { MainSettings settings = MainSettings.LoadFromXML("NonExistingFile.xml"); Assert.AreEqual(settings.InRowToWin, 3); }
public void TestLoadFromXML() { MainSettings settings = MainSettings.LoadFromXML("TestConfig\\Settings.xml"); Assert.AreEqual(settings.Language, "PL"); }