private void galnetAlwaysOnUnchecked(object sender, RoutedEventArgs e) { GalnetConfiguration configuration = GalnetConfiguration.FromFile(); configuration.galnetAlwaysOn = galnetAlwaysOn.IsChecked.Value; configuration.ToFile(); galnetMonitor()?.Reload(); }
public ConfigurationWindow() { InitializeComponent(); monitor = ((GalnetMonitor)EDDI.Instance.ObtainMonitor("Galnet monitor")); GalnetConfiguration configuration = GalnetConfiguration.FromFile(); languageComboBox.SelectedValue = configuration.language; }
public ConfigurationWindow() { InitializeComponent(); GalnetConfiguration configuration = GalnetConfiguration.FromFile(); Dictionary <string, string> langs = galnetMonitor()?.GetGalnetLocales(); languageComboBox.ItemsSource = langs.Keys; languageComboBox.SelectedValue = configuration.language; galnetAlwaysOn.IsChecked = configuration.galnetAlwaysOn; }
public GalnetMonitor() { // Remove the old configuration file if it still exists if (File.Exists(Constants.DATA_DIR + @"\galnet")) { try { File.Delete(Constants.DATA_DIR + @"\galnet"); } catch { } } configuration = GalnetConfiguration.FromFile(); }
private void onLanguageChanged(object sender, SelectionChangedEventArgs e) { string language = (string)((ComboBox)e.Source).SelectedValue; GalnetConfiguration configuration = GalnetConfiguration.FromFile(); if (language != null && language != configuration.language) { // If the language changes we clear out the old articles GalnetSqLiteRepository.Instance.DeleteNews(); configuration.lastuuid = null; configuration.language = language; configuration.ToFile(); galnetMonitor()?.Reload(); } }
public void Reload() { configuration = GalnetConfiguration.FromFile(); }