Archived
1
0
This repository has been archived on 2021-10-19. You can view files and clone it, but cannot push or open issues or pull requests.
nonabgs/Util/AppConfig.cs

44 lines
1.3 KiB
C#

using System;
using System.ComponentModel;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace NonaBGS.Util {
public class AppConfig : INotifyPropertyChanged {
private static readonly string default_journal_location = "%UserProfile%\\Saved Games\\Frontier Developments\\Elite Dangerous";
private string journal_location = default_journal_location;
private bool useeddb = false;
public string DefaultJournalLocation => default_journal_location;
public bool UseEDDB {
get => useeddb;
set {
useeddb = value;
FirePropertyChanged("UseEDDB");
}
}
public string JournalLocation {
get {
if (journal_location == null) {
return DefaultJournalLocation;
}
return journal_location;
}
set {
journal_location = value;
FirePropertyChanged("JournalLocation");
}
}
private void FirePropertyChanged(string property) {
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(property));
}
public event PropertyChangedEventHandler PropertyChanged;
}
}