Exemplo n.º 1
0
 public WindowViewModel(INotificationHandler notificationHandler)
 {
     if (BSMTSettingsManager.Instance == null)
     {
         BSMTSettingsManager.UseDefaultManager();
     }
     _notificationHandler = notificationHandler;
     try
     {
         SettingsViewModel = new SettingsViewModel();
         //AddLocation(new BeatSaberInstall(@"C:\SteamInstall", InstallType.Steam));
         //AddLocation(new BeatSaberInstall(@"C:\OculusInstall\DDDDDDDDDD\AAAAAAAAAA\VVVVVVVVVVVV\CCCCCCCCCCCCCC\SSSSSSSSSSSSSS\F", InstallType.Oculus));
         //AddLocation(new BeatSaberInstall(@"C:\ManualInstall", InstallType.Manual));
         var detectedLocations = BeatSaberTools.GetBeatSaberPathsFromRegistry();
         BeatSaberLocations = new ObservableCollection <BeatSaberInstall>(detectedLocations);
         SetInstallByPath(SettingsViewModel.CurrentSettings.ChosenInstallPath);
     }
     catch (Exception ex)
     {
         ShowError(ex);
         if (BeatSaberLocations == null)
         {
             BeatSaberLocations = new ObservableCollection <BeatSaberInstall>();
             SetInstallByPath(SettingsViewModel.CurrentSettings.ChosenInstallPath);
         }
     }
 }
 public SettingsViewModel()
 {
     CurrentSettings            = new SettingsModel(PreviousSettings);
     ExecuteOnAppSettingsChange = () =>
     {
         NotifyPropertyChanged(string.Empty);
     };
     BSMTSettingsManager.SubscribeExecuteOnChange(new WeakAction(ExecuteOnAppSettingsChange));
 }
        public WindowViewModel()
        {
            if (BSMTSettingsManager.Instance == null)
            {
                BSMTSettingsManager.UseDefaultManager();
            }
            var detectedLocations = BeatSaberTools.GetBeatSaberPathsFromRegistry();

            BeatSaberLocations = new ObservableCollection <BeatSaberInstall>(detectedLocations);
            SettingsViewModel  = new SettingsViewModel();
            //AddLocation(new BeatSaberInstall(@"C:\SteamInstall", InstallType.Steam));
            //AddLocation(new BeatSaberInstall(@"C:\OculusInstall\DDDDDDDDDD\AAAAAAAAAA\VVVVVVVVVVVV\CCCCCCCCCCCCCC\SSSSSSSSSSSSSS\F", InstallType.Oculus));
            //AddLocation(new BeatSaberInstall(@"C:\ManualInstall", InstallType.Manual));
            SetInstallByPath(SettingsViewModel.CurrentSettings.ChosenInstallPath);
        }