public void Load() { using (StreamReader myReader = new StreamReader(DataDirectory + "settings.json")) { MainSettings newFile = new MainSettings(); jsonReader = new JsonTextReader(myReader); newFile = serializer.Deserialize <MainSettings>(jsonReader); } }
/// <summary> /// Loads an existing profile from the folder supplied /// </summary> /// <param name="profileName"></param> public Profile(ref MainSettings mainSettings, string profileName) { Settings = new ProfileSettings(ref mainSettings, profileName); Authenticate(); if (!Settings.MainSettings.NoDownloading) { CreateData(); } }
public Profile(ref MainSettings mainSettings, ConfigClass config) { Settings = new ProfileSettings(ref mainSettings) { Config = config }; Authenticate(); if (!Settings.MainSettings.NoDownloading) { CreateData(); } }
public ProfileSettings(ref MainSettings mainSettings) { MainSettings = mainSettings; mainSettings.CheckInternetAccess(); CheckForScopesFile(); if (File.Exists(MainSettings.DataDirectory + ProfileName + $"\\{ProfileName}.json")) { Console.WriteLine(); using (StreamReader myReader = new StreamReader(MainSettings.DataDirectory + ProfileName + $"\\{ProfileName}.json")) { ProfileSettings newFile = new ProfileSettings(); MainSettings.jsonReader = new JsonTextReader(myReader); newFile = MainSettings.serializer.Deserialize <ProfileSettings>(MainSettings.jsonReader); AuthorisationData = newFile.AuthorisationData; Config = newFile.Config; LoadedFromFile = true; } } else { if (File.Exists("config.txt")) { using (StreamReader myReader = new StreamReader("config.txt")) { MainSettings.jsonReader = new JsonTextReader(myReader); Config = MainSettings.serializer.Deserialize <ConfigClass>(MainSettings.jsonReader); Console.WriteLine("Config settings imported."); Console.WriteLine(); } } else { GetConfigDataFromUser(); } } EsiClient = new EsiClient(Config.ConfigOutput()); }
/// <summary> /// Default constructor, settings must be passed in /// This will load all available data. /// </summary> /// <param name="settings"></param> public SDEData(ref MainSettings settings) { Settings = settings; LoadData(); }
internal void Startup() { Profiles = new List <Profile>(); Settings = new MainSettings(); SDE = new SDEData(ref Settings); }