protected override void HandleApplicationClosing() { base.HandleApplicationClosing(); if (!_appInfo.AutoRun && (!ConfigurationManager.SaveConfiguration(MRCCompressorGlobals.GetApplicationConfigurationFilePath(), FrameworkGlobals.ApplicationConfiguration) || !ConfigurationManager.SaveConfiguration(MRCCompressorGlobals.GetSaveAsPDFMRCActionConfigurationFilePath(), MRCCompressorGlobals.ImageSaveAsPDFMRCActionConfiguration))) { MessageBox.Show(FrameworkGlobals.MessagesLocalizer.GetString("saveConfigurationFailure", FrameworkGlobals.ApplicationConfiguration.Language), FrameworkGlobals.MessagesLocalizer.GetString("saveConfigurationFailureTitle", FrameworkGlobals.ApplicationConfiguration.Language), MessageBoxButtons.OK, MessageBoxIcon.Error); } }
protected override bool InitializeAppConfiguration() { if (!base.InitializeAppConfiguration()) { return(false); } if (!_appInfo.AutoRun) { try { MRCCompressorGlobals.ImageSaveAsPDFMRCActionConfiguration = (ImageSaveAsPDFMRCActionConfiguration)ConfigurationManager.InitializeConfigurationInstanceEx(MRCCompressorGlobals.GetSaveAsPDFMRCActionConfigurationFilePath(), typeof(ImageSaveAsPDFMRCActionConfiguration)); } catch (Exception) { MessageBox.Show(FrameworkGlobals.MessagesLocalizer.GetString("readImageSaveAsPDFConfigurationFailure", FrameworkGlobals.ApplicationConfiguration.Language), FrameworkGlobals.MessagesLocalizer.GetString("readConfigurationFailureTitle", FrameworkGlobals.ApplicationConfiguration.Language), MessageBoxButtons.OK, MessageBoxIcon.Error); MRCCompressorGlobals.ImageSaveAsPDFMRCActionConfiguration = ConfigurationManager.ResetDefaultImageSaveAsPDFMRCActionConfiguration(); } } else { MRCCompressorGlobals.ImageSaveAsPDFMRCActionConfiguration = ConfigurationManager.ResetDefaultImageSaveAsPDFMRCActionConfiguration(); CommandLineParsingUtilities.ParseCommandLineArgs(_appInfo.CommandLineArguments, FrameworkGlobals.ApplicationConfiguration, imageSaveAsPdfMrcActionConfiguration: MRCCompressorGlobals.ImageSaveAsPDFMRCActionConfiguration); if (FrameworkGlobals.ApplicationConfiguration.MinimizedWindow) { _view.Minimize(); } } return(true); }