@@ -42,6 +42,9 @@ public MainWindow() {
4242 startup ( ) ;
4343 }
4444
45+ /// <summary>
46+ /// Retrieves the latest available version from the server.
47+ /// </summary>
4548 private void GetVersion ( object sender , AsyncCompletedEventArgs e ) {
4649 try {
4750 PROGRAM_VERSION = File . ReadAllText ( VERSION_PATH ) ;
@@ -66,6 +69,9 @@ private void GetVersion(object sender, AsyncCompletedEventArgs e) {
6669 }
6770 }
6871
72+ /// <summary>
73+ /// Startup method, runs when code execution begins.
74+ /// </summary>
6975 void startup ( ) {
7076 subTitle . Content = "Version: " + PROGRAM_VERSION ;
7177
@@ -168,9 +174,9 @@ void startup() {
168174 }
169175 }
170176
171- /*
172- * When the user clicks to open the Projet Tracker program
173- */
177+ /// <summary>
178+ /// Launches the program from PROGRAM_PATH.
179+ /// </summary>
174180 private void LaunchButtonClick ( object sender , RoutedEventArgs e ) {
175181 ProcessStartInfo start = new ProcessStartInfo {
176182 // Enter the executable to run, including the complete path
@@ -183,10 +189,10 @@ private void LaunchButtonClick(object sender, RoutedEventArgs e) {
183189 Environment . Exit ( 0 ) ;
184190 }
185191
186-
187- /* When the user clicks the reinstall button
188- * This runs the same install button procedure, just deletes the contents of the program first and sets uninstall to false
189- */
192+ /// <summary>
193+ /// Runs when the user clicks on the reinstall button.
194+ /// Uninstalls and then installs the program.
195+ /// </summary>
190196 private void ReinstallButtonClick ( object sender , RoutedEventArgs e ) {
191197 reinstallButton . Visibility = Visibility . Hidden ;
192198 installButton . Visibility = Visibility . Hidden ;
@@ -218,9 +224,11 @@ private void ReinstallButtonClick(object sender, RoutedEventArgs e) {
218224
219225 FinalResult ( "Project Tracker has been installed!" ) ;
220226 }
221- /*
222- * When the user clicks on the install button
223- */
227+
228+ /// <summary>
229+ /// Runs when the user clicks on the install button.
230+ /// If the program is already installed, it becomes an uninstall button.
231+ /// </summary>
224232 private void InstallButtonClick ( object sender , RoutedEventArgs e ) {
225233 if ( retrying == true ) {
226234 installButton . Content = "Install" ;
@@ -329,11 +337,15 @@ private void InstallButtonClick(object sender, RoutedEventArgs e) {
329337
330338 FinalResult ( "Successfully uninstalled!" ) ;
331339 } ) ) ;
332-
333340 }
334341
335342 }
336343
344+ /// <summary>
345+ /// A final display presented to the user after code execution has finished.
346+ /// Used to display the success or failure of the installation.
347+ /// </summary>
348+ /// <param name="main">The main title text.</param>
337349 public void FinalResult ( string main ) {
338350 Dispatcher . Invoke ( new Action ( ( ) => {
339351 installBar . Visibility = Visibility . Hidden ;
@@ -366,6 +378,9 @@ public void FinalResult(string main) {
366378 } ) ) ;
367379 }
368380
381+ /// <summary>
382+ /// Runs before window is closed after the user closes the program.
383+ /// </summary>
369384 private void Window_Closing ( object sender , CancelEventArgs e ) {
370385 Environment . Exit ( 0 ) ;
371386 }
0 commit comments