Esempio n. 1
0
        /// <summary>
        /// Imports the provided serialization object.
        /// </summary>
        private static void Import()
        {
            EveMonClient.Trace("begin");

            // When null, we just reset
            if (s_settings == null)
            {
                s_settings = new SerializableSettings();
            }

            try
            {
                // API settings
                SSOClientID     = s_settings.SSOClientID ?? string.Empty;
                SSOClientSecret = s_settings.SSOClientSecret ?? string.Empty;

                // User settings
                UI                          = s_settings.UI;
                G15                         = s_settings.G15;
                Proxy                       = s_settings.Proxy;
                Updates                     = s_settings.Updates;
                Calendar                    = s_settings.Calendar;
                Exportation                 = s_settings.Exportation;
                MarketPricer                = s_settings.MarketPricer;
                Notifications               = s_settings.Notifications;
                Compatibility               = s_settings.Compatibility;
                LoadoutsProvider            = s_settings.LoadoutsProvider;
                PortableEveInstallations    = s_settings.PortableEveInstallations;
                CloudStorageServiceProvider = s_settings.CloudStorageServiceProvider;

                // Scheduler
                Scheduler.Import(s_settings.Scheduler);
            }
            finally
            {
                EveMonClient.Trace("done");

                // Notify the subscribers
                EveMonClient.OnSettingsChanged();
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Imports the data.
        /// </summary>
        private static void ImportData()
        {
            EveMonClient.Trace("begin");

            if (s_settings == null)
            {
                s_settings = new SerializableSettings();
            }

            EveMonClient.ResetCollections();
            EveMonClient.Characters.Import(s_settings.Characters);
            EveMonClient.ESIKeys.Import(s_settings.ESIKeys);
            EveMonClient.Characters.ImportPlans(s_settings.Plans);
            EveMonClient.MonitoredCharacters.Import(s_settings.MonitoredCharacters);

            OnImportCompleted();

            EveMonClient.Trace("done");

            // Notify the subscribers
            EveMonClient.OnSettingsChanged();
        }