Example #1
0
        private void CheckVersion()
        {
            PersistentStorageData data = PersistentStorageHelper.Load(PersistantStorageName);
            bool executeCheck          = false;

            if (data != null && data.Count > 0)
            {
                // get the last update date from the registry:
                lastUpdateCheck = data.GetDateTime("LastUpdateDate");
                sleepTime       = (int)data.GetUInt("SleepTimeBeforeUpdateCheck", SleepTimeBeforeUpdateCheck) * 1000;

                // check if update-check was performed at least one week ago:
                if (lastUpdateCheck.AddDays(PeriodBeforeUpdateCheck) < DateTime.Today)
                {
                    executeCheck = true;
                }
                else
                {
                    // prevent updating the date inside the registry:
                    lastUpdateCheck = DateTime.MinValue;
                }
            }
            else
            {
                executeCheck = true;
            }

            if (executeCheck && sleepTime != 0)
            {
                // start asynchronously new thread that will perform check and update the registry:
                Thread threadCheck = new Thread(PerformUpdateCheck);
                threadCheck.Start();
            }
        }
Example #2
0
        /// <summary>
        /// Restores the stored state of the editor.
        /// </summary>
        public void RestoreState()
        {
            PersistentStorageData data = PersistentStorageHelper.Load(ToolName);

            if (data != null && data.Count > 0)
            {
                NavigateTo(data.GetString(Settings_Path));
                ImportFavorites(data.GetMultiString(Settings_Favorites));
            }

            navigator.Clear();
            RefreshNavigationButtons();
            RefreshFavoritesMenu();
        }
Example #3
0
        public void RestoreState()
        {
            PersistentStorageData data = PersistentStorageHelper.Load(ToolName);

            if (data != null && data.Count > 0)
            {
                string[] storedFilter = data.GetMultiString("Filter");
                if (storedFilter == null)
                {
                    string f = data.GetString("Filter");

                    if (f != null)
                    {
                        storedFilter = new string[] { f }
                    }
                    ;
                }

                FilterMessages = storedFilter;
            }
        }