protected override void OnStartup(StartupEventArgs e) { InitEviroment(); //Logger.info("Compass start up"); //Get Current Cultrue CheckSetting(); GlobalData.GetCulture(); //Base Startup base.OnStartup(e); //var bootstrapper = new Bootstrapper(); string[] args = Environment.GetCommandLineArgs(); if (args.Length == 2) { StartType = AppStartType.OpenFile; } else if ((args.Length == 3 && args[1] == "create")) { StartType = AppStartType.CreateLibrary; } else if (args.Length == 4 && args[2] == "edit") { StartType = AppStartType.EditLibrary; } else { StartType = AppStartType.Normal; } if (StartType == AppStartType.CreateLibrary || StartType == AppStartType.EditLibrary) { //create/edit Custom Library //don't show splash window IsNormalProcess = false; GlobalData.IsStandardMode = false; _mainBootstrapper = new CompassBootstrapper <MainIntegrationWindow>(new Action(RegisterMainService)); _mainBootstrapper.Run(); UpdateWindowStyle(); } else { IsNormalProcess = true; _spashBootstrapper = new CompassBootstrapper <SplashWindow>(new Action(RegisterSplashService)); _spashBootstrapper.Run(); } //Capture the exception this.DispatcherUnhandledException += App_DispatcherUnhandledException; }
public ResizePageViewModel(IDragDropService dragDrop, IShareService shareService, IResizeService resizeService, IPageDialogService pageDialogService, IProgressBarDialogService progressBar, IFileSystemPermissionDialogService fileSystemPermissionDialogService, IApplicationService applicationService, IImageFileService imageFileService, ILocalSettings <ResizeSettings> localSettings, ILoggerService loggerService, ObservableCollection <ImageFile> selectedFiles, INavigationService navigationService, IResourceService resourceLoader, AppStartType appStartType) : base(loggerService) { try { _appStartType = appStartType; _fileSystemPermissionDialogService = fileSystemPermissionDialogService; _dragDropService = dragDrop; _shareService = shareService; _resizeService = resizeService; _localSettings = localSettings; _localSettings.Settings.PropertyChanged += Settings_PropertyChanged; _pageDialogService = pageDialogService; _progressBarDialogService = progressBar; _applicationService = applicationService; _selectedFiles = selectedFiles; _resourceLoader = resourceLoader; _navigationService = navigationService; _loggerService = loggerService; _imageFileService = imageFileService; ImageFiles = new ObservableCollection <ImageFile>(); if (_selectedFiles != null) { ImageFiles = _selectedFiles; } //get settings LoadSettings(); if (IsShareTarget) { OverwriteFiles = false; } //update preview ApplyPreviewDimensions(); PropertyChanged += ResizePageViewModel_PropertyChanged; _loggerService?.LogEvent(nameof(ResizePageViewModel)); } catch (Exception e) { _loggerService?.LogException(nameof(ResizePageViewModel), e); } }