1010using VisualStudioDiscordRPC . Shared . Nests ;
1111using VisualStudioDiscordRPC . Shared . Utils ;
1212using System . Windows . Input ;
13+ using System . Windows . Forms ;
1314
1415namespace VisualStudioDiscordRPC . Shared . ViewModels
1516{
@@ -266,6 +267,7 @@ public BaseButtonPlug SecondButtonPlug
266267 public RelayCommand ShowSecretSolutionsCommand { get ; }
267268 public RelayCommand ShowPrivateRepositoriesCommand { get ; }
268269 public RelayCommand ShowCustomTextPlugsEditorCommand { get ; }
270+ public RelayCommand SelectSecretFolderCommand { get ; }
269271
270272 public SettingsViewModel ( )
271273 {
@@ -287,6 +289,7 @@ public SettingsViewModel()
287289 ShowSecretSolutionsCommand = new RelayCommand ( ShowSecretSolutionsEditor ) ;
288290 ShowPrivateRepositoriesCommand = new RelayCommand ( ShowPrivateRepositoriesEditor ) ;
289291 ShowCustomTextPlugsEditorCommand = new RelayCommand ( ShowCustomTextPlugsEditor ) ;
292+ SelectSecretFolderCommand = new RelayCommand ( SelectSecretFolder ) ;
290293 }
291294
292295 private void ShowSecretSolutionsEditor ( object parameter )
@@ -321,5 +324,24 @@ private void ShowCustomTextPlugsEditor(object parameter)
321324
322325 OnPropertyChanged ( nameof ( AvailableTextPlugs ) ) ;
323326 }
327+
328+ private void SelectSecretFolder ( object parameter )
329+ {
330+ using ( var folderDialog = new System . Windows . Forms . FolderBrowserDialog ( ) )
331+ {
332+ folderDialog . Description = "Select folder to hide all solutions in it" ;
333+ folderDialog . ShowNewFolderButton = false ;
334+
335+ if ( folderDialog . ShowDialog ( ) == System . Windows . Forms . DialogResult . OK )
336+ {
337+ string selectedPath = folderDialog . SelectedPath ;
338+ if ( ! string . IsNullOrEmpty ( selectedPath ) )
339+ {
340+ _solutionSecrecyService . AddSecretSolution ( selectedPath ) ;
341+ OnPropertyChanged ( nameof ( SecretSolution ) ) ;
342+ }
343+ }
344+ }
345+ }
324346 }
325347}
0 commit comments