Ejemplo n.º 1
0
        /// <summary>
        /// load the settings and all the feed data from isolated storage
        /// </summary>
        public void LoadState(bool forceRefresh = false)
        {
            IsBusy = true;

            if (forceRefresh)
            {
                settings = GetSettingsFromConfigFile();
                InitializeProperties();
            }
            else
            {
                var isoData = IsoHelper.LoadIsoString(ISO_STORE_FILE);
                if (isoData == null || isoData.Length == 0)
                {
                    settings = GetSettingsFromConfigFile();
                    InitializeProperties();
                }
                else
                {
                    var configSettings = GetSettingsFromConfigFile();
                    var isoSettings    = DeserializeSettings(isoData);
                    if (isoSettings.Version < configSettings.Version)
                    {
                        settings = configSettings;
                        InitializeProperties();
                    }
                    else
                    {
                        settings = isoSettings;
                        InitializeProperties();
                    }
                }
            }

            IsBusy = false;
        }