private static JObject LoadPreviousVersion(string domain)
        {
            var currentVersion  = Assembly.GetExecutingAssembly().GetName().Version;
            var parentDirectory = Path.GetDirectoryName(SettingsBase.StorageDirectory);

            if (!Directory.Exists(parentDirectory))
            {
                return(null);
            }

            var previousVersion = new Version(0, 0);

            foreach (var directory in Directory.EnumerateDirectories(parentDirectory))
            {
                var versionString = Path.GetFileName(directory);
                if (versionString == null ||
                    !System.Version.TryParse(versionString, out var version) ||
                    version >= currentVersion)
                {
                    continue;
                }

                if (version > previousVersion)
                {
                    previousVersion = version;
                }
            }

            var previousVersionFile = Path.Combine(
                parentDirectory,
                previousVersion.ToString(),
                SettingsBase.GetSettingsFilename(domain));

            if (!File.Exists(previousVersionFile))
            {
                return(null);
            }

            try
            {
                return(JObject.Parse(File.ReadAllText(previousVersionFile)));
            }
            catch (JsonException)
            {
                return(null);
            }
        }
 internal static string GetSettingsFilePath(string domain)
 => Path.Combine(SettingsBase.StorageDirectory, SettingsBase.GetSettingsFilename(domain));