Exemplo n.º 1
0
 public void Load()
 {
     using (StreamReader myReader = new StreamReader(DataDirectory + "settings.json"))
     {
         MainSettings newFile = new MainSettings();
         jsonReader = new JsonTextReader(myReader);
         newFile    = serializer.Deserialize <MainSettings>(jsonReader);
     }
 }
Exemplo n.º 2
0
 /// <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();
     }
 }
Exemplo n.º 3
0
 public Profile(ref MainSettings mainSettings, ConfigClass config)
 {
     Settings = new ProfileSettings(ref mainSettings)
     {
         Config = config
     };
     Authenticate();
     if (!Settings.MainSettings.NoDownloading)
     {
         CreateData();
     }
 }
Exemplo n.º 4
0
 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());
 }
Exemplo n.º 5
0
        /// <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();
        }
Exemplo n.º 6
0
 internal void Startup()
 {
     Profiles = new List <Profile>();
     Settings = new MainSettings();
     SDE      = new SDEData(ref Settings);
 }