protected override void HandleApplicationClosing() { base.HandleApplicationClosing(); if (!_appInfo.AutoRun && (!ConfigurationManager.SaveConfiguration(PdfReducerGlobals.GetApplicationConfigurationFilePath(), FrameworkGlobals.ApplicationConfiguration) || !ConfigurationManager.SaveConfiguration(PdfReducerGlobals.GetReduceActionConfigurationFilePath(), PdfReducerGlobals.ReduceActionConfiguration))) { _view.ShowErrorMessage(FrameworkGlobals.MessagesLocalizer.GetString("saveConfigurationFailure", FrameworkGlobals.ApplicationLanguage), FrameworkGlobals.MessagesLocalizer.GetString("saveConfigurationFailureTitle", FrameworkGlobals.ApplicationLanguage)); } }
protected override bool InitializeAppConfiguration() { if (!base.InitializeAppConfiguration()) { return(false); } if (!_appInfo.AutoRun) { try { PdfReducerGlobals.ReduceActionConfiguration = (PDFReduceActionConfiguration)ConfigurationManager.InitializeConfigurationInstanceEx(PdfReducerGlobals.GetReduceActionConfigurationFilePath(), typeof(PDFReduceActionConfiguration)); } catch { _view.ShowErrorMessage(FrameworkGlobals.MessagesLocalizer.GetString("readReduceConfigurationFailure", FrameworkGlobals.ApplicationLanguage), FrameworkGlobals.MessagesLocalizer.GetString("readConfigurationFailureTitle", FrameworkGlobals.ApplicationLanguage)); PdfReducerGlobals.ReduceActionConfiguration = ConfigurationManager.ResetDefaultPDFReduceActionConfiguration(); } } else { PdfReducerGlobals.ReduceActionConfiguration = ConfigurationManager.ResetDefaultPDFReduceActionConfiguration(); CommandLineParsingUtilities.ParseCommandLineArgs(_appInfo.CommandLineArguments, FrameworkGlobals.ApplicationConfiguration, PdfReducerGlobals.ReduceActionConfiguration); if (FrameworkGlobals.ApplicationConfiguration.MinimizedWindow) { _view.Minimize(); } } return(true); }
public PDFReducerController(bool autoRun, string[] args) : base( new PassportPDFDesktopAppInformation( PdfReducerGlobals.PRODUCT_NAME, PdfReducerGlobals.PASSPORT_PDF_APP_ID, PdfReducerGlobals.SOURCE_CODE_URL, AssemblyUtilities.GetVersion(), Icon.ExtractAssociatedIcon(Assembly.GetExecutingAssembly().Location), Properties.Resources.pdf_reducer_cloud_final_logo, PdfReducerGlobals.INPUT_FILE_TYPE, PdfReducerGlobals.GetApplicationConfigurationFilePath(), autoRun, args)) { }