@@ -13,6 +13,9 @@ namespace NETworkManager.ViewModels;
1313public class SettingsSettingsViewModel : ViewModelBase
1414{
1515 #region Variables
16+ /// <summary>
17+ /// Gets or sets the action to execute when the associated object is closed.
18+ /// </summary>
1619 public Action CloseAction { get ; set ; }
1720
1821 /// <summary>
@@ -143,6 +146,9 @@ public int MaximumNumberOfBackups
143146
144147 #region Constructor, LoadSettings
145148
149+ /// <summary>
150+ /// Initializes a new instance of the <see cref="SettingsSettingsViewModel" /> class and loads the current settings.
151+ /// </summary>
146152 public SettingsSettingsViewModel ( )
147153 {
148154 _isLoading = true ;
@@ -152,14 +158,13 @@ public SettingsSettingsViewModel()
152158 _isLoading = false ;
153159 }
154160
161+ /// <summary>
162+ /// Loads the application settings from the current settings folder location.
163+ /// </summary>
155164 private void LoadSettings ( )
156165 {
157166 Location = SettingsManager . GetSettingsFolderLocation ( ) ;
158167 IsDefaultLocation = string . Equals ( Location , SettingsManager . GetDefaultSettingsFolderLocation ( ) , StringComparison . OrdinalIgnoreCase ) ;
159-
160- Debug . WriteLine ( Location ) ;
161- Debug . WriteLine ( SettingsManager . GetDefaultSettingsFolderLocation ( ) ) ;
162-
163168 IsDailyBackupEnabled = SettingsManager . Current . Settings_IsDailyBackupEnabled ;
164169 MaximumNumberOfBackups = SettingsManager . Current . Settings_MaximumNumberOfBackups ;
165170 }
@@ -168,15 +173,27 @@ private void LoadSettings()
168173
169174 #region ICommands & Actions
170175
176+ /// <summary>
177+ /// Gets the command that opens a location when executed.
178+ /// </summary>
171179 public ICommand OpenLocationCommand => new RelayCommand ( _ => OpenLocationAction ( ) ) ;
172180
181+ /// <summary>
182+ /// Opens the settings folder location in Windows Explorer.
183+ /// </summary>
173184 private static void OpenLocationAction ( )
174185 {
175186 Process . Start ( "explorer.exe" , SettingsManager . GetSettingsFolderLocation ( ) ) ;
176187 }
177188
189+ /// <summary>
190+ /// Gets the command that resets the application settings to their default values.
191+ /// </summary>
178192 public ICommand ResetSettingsCommand => new RelayCommand ( _ => ResetSettingsAction ( ) ) ;
179193
194+ /// <summary>
195+ /// Resets the application settings to their default values.
196+ /// </summary>
180197 private void ResetSettingsAction ( )
181198 {
182199 ResetSettings ( ) . ConfigureAwait ( false ) ;
@@ -185,8 +202,18 @@ private void ResetSettingsAction()
185202 #endregion
186203
187204 #region Methods
205+ /// <summary>
206+ /// Gets the command that opens the location folder selection dialog.
207+ /// </summary>
188208 public ICommand BrowseLocationFolderCommand => new RelayCommand ( p => BrowseLocationFolderAction ( ) ) ;
189209
210+ /// <summary>
211+ /// Opens a dialog that allows the user to select a folder location and updates the Location property with the
212+ /// selected path if the user confirms the selection.
213+ /// </summary>
214+ /// <remarks>If the Location property is set to a valid directory path, it is pre-selected in the dialog.
215+ /// This method does not return a value and is intended for use in a user interface context where folder selection
216+ /// is required.</remarks>
190217 private void BrowseLocationFolderAction ( )
191218 {
192219 using var dialog = new System . Windows . Forms . FolderBrowserDialog ( ) ;
@@ -200,13 +227,28 @@ private void BrowseLocationFolderAction()
200227 Location = dialog . SelectedPath ;
201228 }
202229
230+ /// <summary>
231+ /// Sets the location path based on the provided drag-and-drop input.
232+ /// </summary>
233+ /// <param name="path">The path to set as the location. This value cannot be null or empty.</param>
203234 public void SetLocationPathFromDragDrop ( string path )
204235 {
205236 Location = path ;
206237 }
207238
239+ /// <summary>
240+ /// Gets the command that initiates the action to change the location.
241+ /// </summary>
208242 public ICommand ChangeLocationCommand => new RelayCommand ( _ => ChangeLocationAction ( ) . ConfigureAwait ( false ) ) ;
209243
244+ /// <summary>
245+ /// Prompts the user to confirm and then changes the location of the application's settings folder.
246+ /// </summary>
247+ /// <remarks>This method displays a confirmation dialog to the user before changing the settings folder
248+ /// location. If the user confirms, it saves the current settings, updates the settings folder location, and
249+ /// restarts the application to apply the changes. No action is taken if the user cancels the confirmation
250+ /// dialog.</remarks>
251+ /// <returns>A task that represents the asynchronous operation.</returns>
210252 private async Task ChangeLocationAction ( )
211253 {
212254 var result = await DialogHelper . ShowConfirmationMessageAsync ( Application . Current . MainWindow ,
@@ -230,8 +272,19 @@ private async Task ChangeLocationAction()
230272 ( Application . Current . MainWindow as MainWindow ) ? . RestartApplication ( ) ;
231273 }
232274
275+ /// <summary>
276+ /// Gets the command that restores the default location settings asynchronously.
277+ /// </summary>
233278 public ICommand RestoreDefaultLocationCommand => new RelayCommand ( _ => RestoreDefaultLocationActionAsync ( ) . ConfigureAwait ( false ) ) ;
234279
280+ /// <summary>
281+ /// Restores the application's settings folder location to the default path after obtaining user confirmation.
282+ /// </summary>
283+ /// <remarks>This method prompts the user to confirm the restoration of the default settings location. If
284+ /// the user confirms, it saves the current settings, clears any custom location, and restarts the application to
285+ /// apply the changes. Use this method when you want to revert to the default settings folder and ensure all changes
286+ /// are properly saved and applied.</remarks>
287+ /// <returns>A task that represents the asynchronous operation.</returns>
235288 private async Task RestoreDefaultLocationActionAsync ( )
236289 {
237290 var result = await DialogHelper . ShowConfirmationMessageAsync ( Application . Current . MainWindow ,
@@ -255,6 +308,13 @@ private async Task RestoreDefaultLocationActionAsync()
255308 ( Application . Current . MainWindow as MainWindow ) ? . RestartApplication ( ) ;
256309 }
257310
311+ /// <summary>
312+ /// Resets the application settings to their default values and restarts the application after user confirmation.
313+ /// </summary>
314+ /// <remarks>Displays a confirmation dialog to the user before proceeding. If the user confirms, the
315+ /// settings are reinitialized to their defaults and the application is restarted. No action is taken if the user
316+ /// cancels the confirmation dialog.</remarks>
317+ /// <returns>A task that represents the asynchronous operation.</returns>
258318 private async Task ResetSettings ( )
259319 {
260320 var result = await DialogHelper . ShowConfirmationMessageAsync ( Application . Current . MainWindow ,
0 commit comments