Exemplo n.º 1
0
        private static ImposterSettings Upgrade(ImposterSettings settings)
        {
            if (settings == null)
            {
                return settings;
            }

            if (string.IsNullOrEmpty(settings.Version))
            {
                var result = MessageBox.Show("Imposter says: Invalid version found in settings.json. Drop all settings and recreate?", 
                    string.Empty, MessageBoxButton.YesNo);

                if (result == MessageBoxResult.Yes)
                {
                    File.Delete(FILE_PATH);

                    return Load();
                }

                return null;
            }
            else
            {
                // We're up to date
                return settings;
            }
        }
Exemplo n.º 2
0
        private static ImposterSettings Upgrade(ImposterSettings settings)
        {
            if (settings == null)
            {
                return(settings);
            }

            if (string.IsNullOrEmpty(settings.Version))
            {
                var result = MessageBox.Show("Imposter says: Invalid version found in settings.json. Drop all settings and recreate?",
                                             string.Empty, MessageBoxButton.YesNo);

                if (result == MessageBoxResult.Yes)
                {
                    File.Delete(FILE_PATH);

                    return(Load());
                }

                return(null);
            }
            else
            {
                // We're up to date
                return(settings);
            }
        }
Exemplo n.º 3
0
 public Imposter()
 {
     _enabledProfiles = new List<Profile>();
     _settings = ImposterSettings.Load();
     InitializeMenu();
 }