@@ -830,7 +830,8 @@ private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
830830 // Ask the user if they want to save the certificate password to the configuration file
831831 var msgresult =
832832 MessageBox . Show ( @"Do you want to save the .PFX password for the next time you use this program?" ,
833- @"Be careful not to store highly confidential information." , MessageBoxButtons . YesNoCancel , MessageBoxIcon . Warning ) ;
833+ @"Be careful not to store highly confidential information." , MessageBoxButtons . YesNoCancel ,
834+ MessageBoxIcon . Warning ) ;
834835
835836 // Log the save message box
836837 Message ( "Save certificate (.pfx) password message box shown to user" , EventType . Information , 1028 ) ;
@@ -839,7 +840,8 @@ private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
839840 {
840841 case DialogResult . Yes :
841842 // Log the user's choice to save the certificate password to the configuration file
842- Message ( "User chose to save the certificate (.pfx) password to the configuration file" , EventType . Information , 1029 ) ;
843+ Message ( "User chose to save the certificate (.pfx) password to the configuration file" ,
844+ EventType . Information , 1029 ) ;
843845
844846 // Save the certificate password to the configuration file if the user clicks Yes
845847 try
@@ -848,8 +850,9 @@ private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
848850 iniFile . WriteValue ( "Program" , "SignToolPath" , textBoxSignToolPath . Text ) ;
849851
850852 // Save timestamp provider to the configuration file
851- iniFile . WriteValue ( "Program" , "TimestampProvider" , comboBoxTimestampProviders . SelectedIndex ) ;
852-
853+ iniFile . WriteValue ( "Program" , "TimestampProvider" ,
854+ comboBoxTimestampProviders . SelectedIndex ) ;
855+
853856 // Save the timestamp URL to the configuration file
854857 iniFile . WriteValue ( "Program" , "TimestampURL" , txtTimestampProviderURL . Text ) ;
855858
@@ -870,7 +873,8 @@ private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
870873 }
871874
872875 // Encrypt the certificate password and save it to the configuration file
873- var encryptedstring = StringCipher . Encrypt ( textBoxPFXPassword . Text , "pMmInS?m24Caae#?2EySvsFUgDsUG06Qzz8R0X8F8WUNn04#g%mP02*36datrZka?cQh/Q2E/Oc4/21%" ) ;
876+ var encryptedstring = StringCipher . Encrypt ( textBoxPFXPassword . Text ,
877+ "pMmInS?m24Caae#?2EySvsFUgDsUG06Qzz8R0X8F8WUNn04#g%mP02*36datrZka?cQh/Q2E/Oc4/21%" ) ;
874878
875879 // Save the encrypted certificate password to the configuration file
876880 iniFile . WriteValue ( "Program" , "CertificatePassword" , encryptedstring ) ;
@@ -881,13 +885,15 @@ private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
881885 }
882886
883887 // Log the application closing message and saved configuration
884- Message ( "Application is closing - .pfx certificate password saved" , EventType . Information , 1030 ) ;
888+ Message ( "Application is closing - .pfx certificate password saved" , EventType . Information ,
889+ 1030 ) ;
885890
886891 Application . ExitThread ( ) ;
887892 break ;
888893 case DialogResult . No :
889894 // Log the user's choice not to save the certificate password to the configuration file
890- Message ( "User chose not to save the certificate (.pfx) password to the configuration file" , EventType . Information , 1031 ) ;
895+ Message ( "User chose not to save the certificate (.pfx) password to the configuration file" ,
896+ EventType . Information , 1031 ) ;
891897
892898 // Do not save the certificate password to the configuration file if the user clicks No
893899 iniFile . WriteValue ( "Program" , "SignToolPath" , textBoxSignToolPath . Text ) ;
@@ -922,7 +928,8 @@ private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
922928 }
923929
924930 // Log the application closing message and not saved configuration
925- Message ( "Application is closing - .pfx certificate password and information not saved" , EventType . Information , 1032 ) ;
931+ Message ( "Application is closing - .pfx certificate password and information not saved" ,
932+ EventType . Information , 1032 ) ;
926933
927934 // Log configuration file save completion message
928935 Message ( "Configuration file saved successfully" , EventType . Information , 1033 ) ;
@@ -977,11 +984,16 @@ private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
977984 iniFile . WriteValue ( "Program" , "CertificatePassword" , "" ) ;
978985
979986 // Log the application closing message and not saved configuration
980- Message ( "Application is closing - .pfx certificate password and information not saved" , EventType . Information , 1033 ) ;
987+ Message ( "Application is closing - .pfx certificate password and information not saved" ,
988+ EventType . Information , 1033 ) ;
981989
982990 // Log configuration file save completion message
983991 Message ( "Configuration file saved successfully" , EventType . Information , 1034 ) ;
984992 }
993+
994+ // Log application closed message
995+ Message ( "Application " + Application . ProductName + @" v." + Application . ProductVersion + " is closed" ,
996+ EventType . Information , 1057 ) ;
985997 }
986998
987999 private void buttonBrowseSignTool_Click ( object sender , EventArgs e )
0 commit comments