Example #1
0
        private void UpgradeFile()
        {
            if (fileVersion == CurrentFileVersion)
            {
                return;
            }

            // if outdated, cycle through all versions
            if (fileVersion == 0)
            {
                DisplayNotificationTimer = true;
                EnableUpdateCheck        = true;
                ++fileVersion;
            }

            if (fileVersion == 1)
            {
                ExpandLinksOnHover = true;
                ++fileVersion;
            }

            if (fileVersion == 2)
            {
                BrowserWindow = new WindowState();
                Plugins       = new PluginConfig();
                PluginsWindow = new WindowState();
                ++fileVersion;
            }

            if (fileVersion == 3)
            {
                EnableTrayHighlight       = true;
                NotificationDurationValue = 25;
                ++fileVersion;
            }

            if (fileVersion == 4)
            {
                Plugins.DisableOfficialFromConfig("clear-columns");
                Plugins.DisableOfficialFromConfig("reply-account");
                ++fileVersion;
            }

            if (fileVersion == 5)
            {
                ++fileVersion;
            }

            if (fileVersion == 6)
            {
                NotificationNonIntrusiveMode = true;
                ++fileVersion;
            }

            // update the version
            fileVersion = CurrentFileVersion;
            Save();
        }