Пример #1
0
        public VolumeManagementHandler(
            UIElement parent,
            IMsixHeroApplication application,
            IInteractionService interactionService,
            IConfigurationService configurationService,
            ISelfElevationProxyProvider <IAppxVolumeManager> volumeManagerProvider,
            IBusyManager busyManager,
            IDialogService dialogService,
            IModuleManager moduleManager)
        {
            this.application           = application;
            this.interactionService    = interactionService;
            this.dialogService         = dialogService;
            this.moduleManager         = moduleManager;
            this.configurationService  = configurationService;
            this.volumeManagerProvider = volumeManagerProvider;
            this.busyManager           = busyManager;

            parent.CommandBindings.Add(new CommandBinding(NavigationCommands.Refresh, this.OnRefresh));
            parent.CommandBindings.Add(new CommandBinding(ApplicationCommands.New, this.OnNew));
            parent.CommandBindings.Add(new CommandBinding(ApplicationCommands.Delete, this.OnDelete, this.CanDelete));
            parent.CommandBindings.Add(new CommandBinding(MsixHeroCommands.SetVolumeAsDefault, this.OnSetVolumeAsDefault, this.CanSetVolumeAsDefault));
            parent.CommandBindings.Add(new CommandBinding(MsixHeroCommands.MountVolume, this.OnMountVolume, this.CanMountVolume));
            parent.CommandBindings.Add(new CommandBinding(MsixHeroCommands.DismountVolume, this.OnDismountVolume, this.CanDismountVolume));
        }
Пример #2
0
        public CertificateExportViewModel(ISelfElevationProxyProvider <ISigningManager> signingManagerFactory, IInteractionService interactionService) : base("Extract certificate", interactionService)
        {
            this.signingManagerFactory = signingManagerFactory;

            this.InputPath = new ChangeableFileProperty("Path to signed MSIX file", interactionService, ChangeableFileProperty.ValidatePathAndPresence)
            {
                Filter = new DialogFilterBuilder("*.msix", "*.cer").BuildFilter()
            };

            this.ExtractCertificate = new ChangeableFileProperty("Path to certificate", interactionService, ChangeableFileProperty.ValidatePath)
            {
                Filter        = new DialogFilterBuilder("*.cer").BuildFilter(),
                OpenForSaving = true
            };

            this.OperationType = new ChangeableProperty <CertOperationType>();
            this.CanExtract    = new ChangeableProperty <bool>();

            this.AddChildren(this.InputPath, this.ExtractCertificate, this.OperationType, this.CanExtract);

            this.InputPath.ValueChanged     += this.InputPathOnValueChanged;
            this.OperationType.ValueChanged += this.OperationTypeOnValueChanged;

            this.RegisterForCommandLineGeneration(this.OperationType, this.InputPath, this.ExtractCertificate);
        }
Пример #3
0
        public PackageSigningViewModel(
            ISelfElevationProxyProvider <ISigningManager> signingManagerFactory,
            IInteractionService interactionService,
            IConfigurationService configurationService,
            ITimeStampFeed timeStampFeed) : base("Package signing", interactionService)
        {
            this.signingManagerFactory = signingManagerFactory;
            this.interactionService    = interactionService;
            this.configurationService  = configurationService;

            this.Files               = new ValidatedChangeableCollection <string>(this.ValidateFiles);
            this.IncreaseVersion     = new ChangeableProperty <IncreaseVersionMethod>();
            this.CertificateSelector = new CertificateSelectorViewModel(
                interactionService,
                signingManagerFactory,
                configurationService?.GetCurrentConfiguration()?.Signing,
                timeStampFeed);
            this.OverrideSubject = new ChangeableProperty <bool>(true);

            this.TabPackages    = new ChangeableContainer(this.Files);
            this.TabAdjustments = new ChangeableContainer(this.IncreaseVersion);
            this.TabCertificate = new ChangeableContainer(this.CertificateSelector);

            this.AddChildren(this.TabPackages, this.TabCertificate, this.TabAdjustments, this.OverrideSubject);
            this.Files.CollectionChanged += (_, _) =>
            {
                this.OnPropertyChanged(nameof(IsOnePackage));
            };

            this.RegisterForCommandLineGeneration(
                this.TabCertificate,
                this.TabPackages,
                this.TabAdjustments,
                this.OverrideSubject);
        }
Пример #4
0
 public TrustViewModel(
     string packagePath,
     IInteractionService interactionService,
     ISelfElevationProxyProvider <ISigningManager> signManagerProvider)
 {
     this.packagePath         = packagePath;
     this.interactionService  = interactionService;
     this.signManagerProvider = signManagerProvider;
 }
Пример #5
0
        public SettingsViewModel(
            IEventAggregator eventAggregator,
            IConfigurationService configurationService,
            IInteractionService interactionService,
            ISelfElevationProxyProvider <ISigningManager> signingManagerFactory)
        {
            this.eventAggregator      = eventAggregator;
            this.configurationService = configurationService;

            var config = configurationService.GetCurrentConfiguration() ?? new Configuration();

            this.TabOther.AddChildren
            (
                this.CertificateOutputPath             = new ChangeableFolderProperty("Certificate output path", interactionService, config.Signing?.DefaultOutFolder?.Resolved),
                this.PackerSignByDefault               = new ChangeableProperty <bool>(config.Packer?.SignByDefault == true),
                this.DefaultRemoteLocationPackages     = new ValidatedChangeableProperty <string>("Remote .msix URL", config.AppInstaller?.DefaultRemoteLocationPackages, this.ValidateUri),
                this.DefaultRemoteLocationAppInstaller = new ValidatedChangeableProperty <string>("Remote .appinstaller URL", config.AppInstaller?.DefaultRemoteLocationAppInstaller, this.ValidateUri)
            );

            this.TabEditors.AddChildren
            (
                this.ManifestEditorType     = new ChangeableProperty <EditorType>(config.Editing.ManifestEditorType),
                this.ManifestEditorPath     = new ChangeableFileProperty("Manifest editor path", interactionService, config.Editing.ManifestEditor.Resolved, this.ValidateManifestEditorPath),
                this.MsixEditorType         = new ChangeableProperty <EditorType>(config.Editing.MsixEditorType),
                this.MsixEditorPath         = new ChangeableFileProperty("MSIX editor path", interactionService, config.Editing.MsixEditor.Resolved, this.ValidateMsixEditorPath),
                this.AppinstallerEditorType = new ChangeableProperty <EditorType>(config.Editing.AppInstallerEditorType),
                this.AppinstallerEditorPath = new ChangeableFileProperty("App installer editor path", interactionService, config.Editing.AppInstallerEditor.Resolved, this.ValidateAppInstallerEditorPath),
                this.PsfEditorType          = new ChangeableProperty <EditorType>(config.Editing.PsfEditorType),
                this.PsfEditorPath          = new ChangeableFileProperty("PSF editor path", interactionService, config.Editing.PsfEditor.Resolved, this.ValidatePsfEditorPath),
                this.PowerShellEditorType   = new ChangeableProperty <EditorType>(config.Editing.PowerShellEditorType),
                this.PowerShellEditorPath   = new ChangeableFileProperty("PowerShell editor path", interactionService, config.Editing.PowerShellEditor.Resolved, this.ValidatePowerShellEditorPath)
            );

            this.TabSigning.AddChildren
            (
                this.CertificateSelector = new CertificateSelectorViewModel(interactionService, signingManagerFactory, config.Signing, true)
            );


            this.AllSettings.AddChildren(
                this.TabSigning,
                this.ConfirmDeletion  = new ChangeableProperty <bool>(config.UiConfiguration?.ConfirmDeletion != false),
                this.DefaultScreen    = new ChangeableProperty <DefaultScreen>(config.UiConfiguration == null ? Infrastructure.Configuration.DefaultScreen.Packages : config.UiConfiguration.DefaultScreen),
                this.ShowReleaseNotes = new ChangeableProperty <bool>(config.Update?.HideNewVersionInfo != true),
                this.TabEditors,
                this.Tools = new ToolsConfigurationViewModel(interactionService, config),
                this.TabOther
                );

            this.CertificateOutputPath.Validators = new[] { ChangeableFolderProperty.ValidatePath };

            this.AppinstallerEditorType.ValueChanged += this.TypeOfPathChanged;
            this.ManifestEditorType.ValueChanged     += this.TypeOfPathChanged;
            this.PsfEditorType.ValueChanged          += this.TypeOfPathChanged;
            this.MsixEditorType.ValueChanged         += this.TypeOfPathChanged;
            this.PowerShellEditorType.ValueChanged   += this.TypeOfPathChanged;
        }
 public GetVolumesHandler(
     IMsixHeroCommandExecutor commandExecutor,
     ISelfElevationProxyProvider <IAppxVolumeManager> volumeManagerProvider,
     IBusyManager busyManager,
     IConfigurationService configurationService)
 {
     this.commandExecutor       = commandExecutor;
     this.configurationService  = configurationService;
     this.volumeManagerProvider = volumeManagerProvider;
     this.busyManager           = busyManager;
 }
 public GetPackagesHandler(
     IMsixHeroCommandExecutor commandExecutor,
     IBusyManager busyManager,
     IEventAggregator eventAggregator,
     IRunningAppsDetector detector,
     ISelfElevationProxyProvider <IAppxPackageQuery> packageQueryProvider)
 {
     detector.Subscribe(this);
     this.commandExecutor      = commandExecutor;
     this.busyManager          = busyManager;
     this.eventAggregator      = eventAggregator;
     this.detector             = detector;
     this.packageQueryProvider = packageQueryProvider;
 }
Пример #8
0
        public MsixHeroCommandExecutor(
            IModuleManager moduleManager,
            IRegionManager regionManager,
            IEventAggregator eventAggregator,
            IConfigurationService configurationService,
            ISelfElevationProxyProvider <IAppxPackageManager> packageManagerProvider,
            ISelfElevationProxyProvider <IAppxLogManager> logManagerProvider,
            ISelfElevationProxyProvider <IAppxVolumeManager> volumeManagerProvider,
            IRunningAppsDetector detector) : base(eventAggregator)
        {
            this.moduleManager          = moduleManager;
            this.regionManager          = regionManager;
            this.eventAggregator        = eventAggregator;
            this.configurationService   = configurationService;
            this.packageManagerProvider = packageManagerProvider;
            this.logManagerProvider     = logManagerProvider;
            this.volumeManagerProvider  = volumeManagerProvider;
            this.detector = detector;

            detector.Subscribe(this);

            this.Handlers[typeof(SetToolFilterCommand)] = (command, token, progress) => this.SetToolFilter((SetToolFilterCommand)command);

            this.Handlers[typeof(SetEventViewerFilterCommand)]  = (command, token, progress) => this.SetEventViewerFilter((SetEventViewerFilterCommand)command);
            this.Handlers[typeof(SetEventViewerSortingCommand)] = (command, token, progress) => this.SetEventViewerSorting((SetEventViewerSortingCommand)command);

            this.Handlers[typeof(GetVolumesCommand)]      = (command, token, progress) => this.GetVolumes((GetVolumesCommand)command, token, progress);
            this.Handlers[typeof(SelectVolumesCommand)]   = (command, token, progress) => this.SelectVolumes((SelectVolumesCommand)command);
            this.Handlers[typeof(SetVolumeFilterCommand)] = (command, token, progress) => this.SetVolumeFilter((SetVolumeFilterCommand)command);

            this.Handlers[typeof(GetPackagesCommand)]     = (command, token, progress) => this.GetPackages((GetPackagesCommand)command, token, progress);
            this.Handlers[typeof(StopPackageCommand)]     = (command, token, progress) => this.StopPackage((StopPackageCommand)command, token);
            this.Handlers[typeof(CheckForUpdatesCommand)] = (command, token, progress) => this.CheckForUpdates((CheckForUpdatesCommand)command, token);
            this.Handlers[typeof(SelectPackagesCommand)]  = (command, token, progress) => this.SelectPackages((SelectPackagesCommand)command);

            this.Handlers[typeof(GetLogsCommand)]         = (command, token, progress) => this.GetLogs((GetLogsCommand)command, token, progress);
            this.Handlers[typeof(SelectLogCommand)]       = (command, token, progress) => this.SelectLog((SelectLogCommand)command);
            this.Handlers[typeof(OpenEventViewerCommand)] = (command, token, progress) => this.OpenEventViewer((OpenEventViewerCommand)command, token, progress);

            this.Handlers[typeof(SetPackageFilterCommand)]            = (command, token, progress) => this.SetPackageFilter((SetPackageFilterCommand)command);
            this.Handlers[typeof(SetCurrentModeCommand)]              = (command, token, progress) => this.SetCurrentMode((SetCurrentModeCommand)command);
            this.Handlers[typeof(SetPackageSortingCommand)]           = (command, token, progress) => this.SetPackageSorting((SetPackageSortingCommand)command);
            this.Handlers[typeof(SetPackageGroupingCommand)]          = (command, token, progress) => this.SetPackageGrouping((SetPackageGroupingCommand)command);
            this.Handlers[typeof(SetPackageSidebarVisibilityCommand)] = (command, token, progress) => this.SetPackageSidebarVisibility((SetPackageSidebarVisibilityCommand)command);
        }
        public PackageExpertViewModel(
            string packagePath,
            IInterProcessCommunicationManager interProcessCommunicationManager,
            ISelfElevationProxyProvider <IAppxPackageQuery> appxPackageQueryProvider,
            ISelfElevationProxyProvider <IAppxVolumeManager> appxVolumeManagerProvider,
            ISelfElevationProxyProvider <ISigningManager> signManager,
            IInteractionService interactionService,
            IAppxFileViewer fileViewer,
            FileInvoker fileInvoker)
        {
            this.interProcessCommunicationManager = interProcessCommunicationManager;
            this.appxPackageQueryProvider         = appxPackageQueryProvider;
            this.appxVolumeManagerProvider        = appxVolumeManagerProvider;
            this.fileViewer  = fileViewer;
            this.fileInvoker = fileInvoker;
            this.packagePath = packagePath;

            this.Trust = new TrustViewModel(packagePath, interactionService, signManager);
        }
        public PackagesManagementCommandHandler(
            IMsixHeroApplication application,
            IInteractionService interactionService,
            IConfigurationService configurationService,
            PrismServices prismServices,
            ISelfElevationProxyProvider <IAppxPackageRunner> packageRunnerProvider,
            ISelfElevationProxyProvider <IAppxPackageInstaller> packageInstallerProvider,
            ISelfElevationProxyProvider <IRegistryManager> registryManagerProvider,
            IBusyManager busyManager)
        {
            this.application              = application;
            this.interactionService       = interactionService;
            this.configurationService     = configurationService;
            this.dialogService            = prismServices.DialogService;
            this.moduleManager            = prismServices.ModuleManager;
            this.packageRunnerProvider    = packageRunnerProvider;
            this.packageInstallerProvider = packageInstallerProvider;
            this.registryManagerProvider  = registryManagerProvider;
            this.busyManager              = busyManager;
            this.fileInvoker              = new FileInvoker(this.interactionService, this.configurationService);

            this.Refresh                       = new DelegateCommand(this.OnRefresh, this.CanRefresh);
            this.AddPackage                    = new DelegateCommand <object>(this.OnAddPackage, this.CanAddPackage);
            this.OpenExplorer                  = new DelegateCommand(this.OnOpenExplorer, this.CanOpenExplorer);
            this.OpenUserExplorer              = new DelegateCommand(this.OnOpenUserExplorer, this.CanOpenUserExplorer);
            this.OpenManifest                  = new DelegateCommand(this.OnOpenManifest, this.CanOpenManifest);
            this.OpenConfigJson                = new DelegateCommand(this.OnOpenConfigJson, this.CanOpenPsfConfig);
            this.OpenStore                     = new DelegateCommand(this.OnOpenStore, this.CanOpenStore);
            this.CheckUpdates                  = new DelegateCommand(this.OnCheckUpdates, this.CanCheckUpdates);
            this.RunTool                       = new DelegateCommand <object>(this.OnRunTool, this.CanRunTool);
            this.RemovePackage                 = new DelegateCommand(this.OnRemovePackage, this.CanRemovePackage);
            this.Copy                          = new DelegateCommand <object>(this.OnCopy, this.CanCopy);
            this.ViewDependencies              = new DelegateCommand(this.OnViewDependencies, this.CanViewDependencies);
            this.ChangeVolume                  = new DelegateCommand(this.OnChangeVolume, this.CanChangeVolume);
            this.ShowAppInstallerDialog        = new DelegateCommand <object>(this.OnShowAppInstallerDialog);
            this.ShowModificationPackageDialog = new DelegateCommand <object>(this.OnShowModificationPackageDialog);
            this.ShowWingetDialog              = new DelegateCommand <object>(this.OnShowWingetDialog);
            this.MountRegistry                 = new DelegateCommand(this.OnMountRegistry, this.CanMountRegistry);
            this.DismountRegistry              = new DelegateCommand(this.OnDismountRegistry, this.CanDismountRegistry);
            this.StartApp                      = new DelegateCommand <object>(this.OnStartApp, this.CanStartApp);
            this.StopApp                       = new DelegateCommand(this.OnStopApp, this.CanStopApp);
            this.Settings                      = new DelegateCommand(this.OnSettings);
        }
Пример #11
0
        public PackageExpertViewModel(
            string packagePath,
            IInterProcessCommunicationManager interProcessCommunicationManager,
            ISelfElevationProxyProvider <IAppxPackageManager> appxPackageManagerProvider,
            ISelfElevationProxyProvider <IAppxVolumeManager> appxVolumeManagerProvider,
            ISelfElevationProxyProvider <ISigningManager> signManager,
            IInteractionService interactionService,
            IRunningAppsDetector runningDetector,
            IDialogService dialogService)
        {
            this.interProcessCommunicationManager = interProcessCommunicationManager;
            this.appxPackageManagerProvider       = appxPackageManagerProvider;
            this.appxVolumeManagerProvider        = appxVolumeManagerProvider;
            this.runningDetector = runningDetector;
            this.packagePath     = packagePath;
            this.dialogService   = dialogService;

            this.Trust = new TrustViewModel(packagePath, interactionService, signManager);
        }
Пример #12
0
        public NewSelfSignedViewModel(
            ISelfElevationProxyProvider <ISigningManager> signingManagerFactory,
            IInteractionService interactionService,
            IConfigurationService configurationService) : base("New self signed certificate", interactionService)
        {
            this.signingManagerFactory = signingManagerFactory;

            this.OutputPath            = new ChangeableFolderProperty("Output path", interactionService, configurationService.GetCurrentConfiguration().Signing?.DefaultOutFolder);
            this.PublisherName         = new ValidatedChangeableProperty <string>("Publisher name", "CN=", ValidatorFactory.ValidateSubject());
            this.PublisherFriendlyName = new ValidatedChangeableProperty <string>("Publisher display name", ValidatePublisherFriendlyName);
            this.Password   = new ValidatedChangeableProperty <string>("Password", ValidatePassword);
            this.ValidUntil = new ValidatedChangeableProperty <DateTime>("Valid until", DateTime.Now.Add(TimeSpan.FromDays(365)), ValidateDateTime);
            this.AddChildren(this.PublisherFriendlyName, this.PublisherName, this.ValidUntil, this.Password, this.OutputPath);

            this.PublisherName.ValueChanged         += this.PublisherNameOnValueChanged;
            this.PublisherFriendlyName.ValueChanged += this.PublisherFriendlyNameOnValueChanged;

            this.RegisterForCommandLineGeneration(this.PublisherFriendlyName, this.PublisherName, this.ValidUntil, this.Password, this.OutputPath);
        }
Пример #13
0
        public ChangeVolumeViewModel(
            IMsixHeroApplication application,
            IInteractionService interactionService,
            IModuleManager moduleManager,
            IDialogService dialogService,
            ISelfElevationProxyProvider <IAppxVolumeManager> volumeManagerFactory) : base("Change volume", interactionService)
        {
            this.application          = application;
            this.interactionService   = interactionService;
            this.moduleManager        = moduleManager;
            this.dialogService        = dialogService;
            this.volumeManagerFactory = volumeManagerFactory;

            // This can be longer...
            var taskForFreeLetters = this.GetAllVolumes();

            taskForFreeLetters.ContinueWith(t =>
            {
                if (t.IsCanceled || t.IsFaulted)
                {
                    return;
                }

                var dr = t.Result.FirstOrDefault();
                if (dr != null)
                {
                    this.TargetVolume.CurrentValue = dr.Name;
                    this.TargetVolume.Commit();
                }

#pragma warning disable 4014
                this.AllVolumes.Load(Task.FromResult(t.Result));
#pragma warning restore 4014
            });

            this.AllVolumes    = new AsyncProperty <List <VolumeCandidateViewModel> >();
            this.TargetVolume  = new ChangeableProperty <string>();
            this.CurrentVolume = new AsyncProperty <VolumeCandidateViewModel>();

            this.AddChildren(this.TargetVolume);
        }
Пример #14
0
        public AppAttachViewModel(ISelfElevationProxyProvider <IAppAttachManager> appAttachManagerFactory, IInteractionService interactionService) : base("Prepare VHD for app attach", interactionService)
        {
            this.appAttachManagerFactory = appAttachManagerFactory;
            this.interactionService      = interactionService;
            this.InputPath = new ChangeableFileProperty("Source MSIX file", interactionService)
            {
                Filter = new DialogFilterBuilder("*" + FileConstants.MsixExtension).BuildFilter()
            };

            this.GenerateScripts = new ChangeableProperty <bool>(true);

            this.InputPath.Validators    = new[] { ChangeableFileProperty.ValidatePathAndPresence };
            this.InputPath.ValueChanged += this.InputPathOnValueChanged;

            this.ExtractCertificate = new ChangeableProperty <bool>();
            this.SizeMode           = new ChangeableProperty <AppAttachSizeMode>();
            this.FixedSize          = new ValidatedChangeableProperty <string>("Fixed size", "100", this.ValidateFixedSize);
            this.AddChildren(this.InputPath, this.GenerateScripts, this.ExtractCertificate, this.FixedSize, this.SizeMode);

            this.RegisterForCommandLineGeneration(this.InputPath, this.GenerateScripts, this.ExtractCertificate, this.FixedSize, this.SizeMode);
        }
Пример #15
0
 public VolumeManagementView(
     IMsixHeroApplication application,
     IInteractionService interactionService,
     IConfigurationService configurationService,
     ISelfElevationProxyProvider <IAppxVolumeManager> volumeManagerProvider,
     IBusyManager busyManager,
     IDialogService dialogService,
     IModuleManager moduleManager)
 {
     this.application = application;
     this.InitializeComponent();
     this.commandHandler = new VolumeManagementHandler(
         this,
         application,
         interactionService,
         configurationService,
         volumeManagerProvider,
         busyManager,
         dialogService,
         moduleManager);
 }
Пример #16
0
        public PackageManagementViewModel(
            IMsixHeroApplication application,
            IInteractionService interactionService,
            ISelfElevationProxyProvider <IAppxPackageManager> packageManagerProvider,
            ISelfElevationProxyProvider <IRegistryManager> registryManagerProvider,
            PrismServices prismServices,
            IBusyManager busyManager,
            IConfigurationService configurationService)
        {
            this.application    = application;
            this.prismServices  = prismServices;
            this.CommandHandler = new PackagesManagementCommandHandler(
                application,
                interactionService,
                configurationService,
                prismServices,
                packageManagerProvider,
                registryManagerProvider,
                busyManager);

            application.EventAggregator.GetEvent <UiExecutedEvent <SelectPackagesCommand> >().Subscribe(this.OnSelectPackages, ThreadOption.UIThread);
        }
Пример #17
0
        public ModificationPackageViewModel(
            IAppxContentBuilder contentBuilder,
            ISelfElevationProxyProvider <ISigningManager> signingManagerFactory,
            IConfigurationService configurationService,
            IInteractionService interactionService) : base("Create modification package", interactionService)
        {
            this.contentBuilder        = contentBuilder;
            this.signingManagerFactory = signingManagerFactory;
            this.configurationService  = configurationService;
            this.interactionService    = interactionService;

            this.InitializeTabProperties();
            this.InitializeTabParentPackage();
            this.InitializeTabContent();
            this.InitializeTabCertificate();

            this.AddChildren(
                this.TabProperties,
                this.TabParentPackage,
                this.TabContent,
                this.TabCertificate);
        }
Пример #18
0
        public NewVolumeViewModel(
            IMsixHeroApplication application,
            IInteractionService interactionService,
            ISelfElevationProxyProvider <IAppxVolumeManager> volumeManager) : base("New volume", interactionService)
        {
            this.application   = application;
            this.volumeManager = volumeManager;
            this.Path          = new ChangeableProperty <string>("WindowsApps");

            // This can be longer...
            var taskForFreeLetters = this.GetLetters();

            taskForFreeLetters.ContinueWith(t =>
            {
                if (t.IsCanceled || t.IsFaulted)
                {
                    return;
                }

                var dr = t.Result.FirstOrDefault();
                if (dr != null)
                {
                    this.SelectedLetter.CurrentValue = dr.PackageStorePath;
                    this.SelectedLetter.Commit();
                }

#pragma warning disable 4014
                this.Letters.Load(Task.FromResult(t.Result));
#pragma warning restore 4014
            });

            this.Letters                = new AsyncProperty <List <VolumeCandidateViewModel> >();
            this.SelectedLetter         = new ChangeableProperty <string>();
            this.PathType               = new ChangeableProperty <NewVolumePathType>();
            this.SetAsDefault           = new ChangeableProperty <bool>();
            this.PathType.ValueChanged += this.PathTypeOnValueChanged;

            this.AddChildren(this.Path, this.PathType, this.SetAsDefault);
        }
Пример #19
0
        public PackViewModel(
            ISelfElevationProxyProvider <ISigningManager> signingManagerFactory,
            IAppxManifestCreator manifestCreator,
            IConfigurationService configurationService,
            IInteractionService interactionService,
            ITimeStampFeed timeStampFeed) : base("Pack MSIX package", interactionService)
        {
            this.signingManagerFactory = signingManagerFactory;
            this.manifestCreator       = manifestCreator;
            var signConfig    = configurationService.GetCurrentConfiguration().Signing ?? new SigningConfiguration();
            var signByDefault = configurationService.GetCurrentConfiguration().Packer?.SignByDefault == true;

            this.InputPath = new ChangeableFolderProperty("Source directory", interactionService, ChangeableFolderProperty.ValidatePath);

            this.OutputPath = new ChangeableFileProperty("Target package path", interactionService, ChangeableFileProperty.ValidatePath)
            {
                OpenForSaving = true,
                Filter        = new DialogFilterBuilder("*" + FileConstants.MsixExtension, "*" + FileConstants.AppxExtension).BuildFilter()
            };

            this.Sign            = new ChangeableProperty <bool>(signByDefault);
            this.Compress        = new ChangeableProperty <bool>(true);
            this.Validate        = new ChangeableProperty <bool>(true);
            this.RemoveDirectory = new ChangeableProperty <bool>();
            this.OverrideSubject = new ChangeableProperty <bool>(true);

            this.SelectedCertificate = new CertificateSelectorViewModel(interactionService, signingManagerFactory, signConfig, timeStampFeed)
            {
                IsValidated = false
            };

            this.InputPath.ValueChanged += this.InputPathOnValueChanged;
            this.Sign.ValueChanged      += this.SignOnValueChanged;

            this.TabSource  = new ChangeableContainer(this.InputPath, this.OutputPath, this.Sign, this.Compress, this.Validate, this.RemoveDirectory);
            this.TabSigning = new ChangeableContainer(this.SelectedCertificate, this.OverrideSubject);

            this.AddChildren(this.TabSource, this.TabSigning);
        }
Пример #20
0
        public AppAttachViewModel(ISelfElevationProxyProvider <IAppAttachManager> appAttachManagerFactory, IInteractionService interactionService) : base("Prepare volume for app attach", interactionService)
        {
            this.appAttachManagerFactory = appAttachManagerFactory;
            this.interactionService      = interactionService;

            this.Files = new ValidatedChangeableCollection <string>(this.ValidateFiles);
            this.Files.CollectionChanged += (_, _) =>
            {
                this.OnPropertyChanged(nameof(IsOnePackage));
            };

            this.TabPackages            = new ChangeableContainer(this.Files);
            this.TabOptions             = new ChangeableContainer(
                this.ExtractCertificate = new ChangeableProperty <bool>(),
                this.GenerateScripts    = new ChangeableProperty <bool>(true),
                this.VolumeType         = new ChangeableProperty <AppAttachVolumeType>(),
                this.SizeMode           = new ChangeableProperty <AppAttachSizeMode>(),
                this.FixedSize          = new ValidatedChangeableProperty <string>("Fixed size", "100", this.ValidateFixedSize)
                );

            this.AddChildren(this.TabPackages, this.TabOptions);
            this.RegisterForCommandLineGeneration(this.Files, this.GenerateScripts, this.VolumeType, this.ExtractCertificate, this.FixedSize, this.SizeMode);
        }
Пример #21
0
        public PackageExpertControl(IEventAggregator eventAggregator,
                                    IInterProcessCommunicationManager ipcManager,
                                    ISelfElevationProxyProvider <IAppxPackageManager> packageManagerProvider,
                                    ISelfElevationProxyProvider <IAppxVolumeManager> volumeManagerProvider,
                                    ISelfElevationProxyProvider <ISigningManager> signingManagerProvider,
                                    IRunningAppsDetector runningDetector,
                                    IInteractionService interactionService,
                                    IDialogService dialogService,
                                    IConfigurationService configurationService
                                    )
        {
            this.context = RegionContext.GetObservableContext(this);
            this.context.PropertyChanged += this.OnPropertyChanged;
            this.ipcManager             = ipcManager;
            this.packageManagerProvider = packageManagerProvider;
            this.volumeManagerProvider  = volumeManagerProvider;
            this.runningDetector        = runningDetector;
            this.interactionService     = interactionService;
            this.signingManagerProvider = signingManagerProvider;
            this.dialogService          = dialogService;
            this.configurationService   = configurationService;

            eventAggregator.GetEvent <ToolsChangedEvent>().Subscribe(this.CreateTools, ThreadOption.UIThread);
        }
Пример #22
0
        public PackageExpertControl(IEventAggregator eventAggregator,
                                    IInterProcessCommunicationManager ipcManager,
                                    ISelfElevationProxyProvider <IAppxPackageQuery> packageQueryProvider,
                                    ISelfElevationProxyProvider <IAppxVolumeManager> volumeManagerProvider,
                                    ISelfElevationProxyProvider <ISigningManager> signingManagerProvider,
                                    IInteractionService interactionService,
                                    IConfigurationService configurationService,
                                    IAppxFileViewer fileViewer,
                                    FileInvoker fileInvoker
                                    )
        {
            this.context = RegionContext.GetObservableContext(this);
            this.context.PropertyChanged += this.OnPropertyChanged;
            this.ipcManager             = ipcManager;
            this.packageQueryProvider   = packageQueryProvider;
            this.volumeManagerProvider  = volumeManagerProvider;
            this.interactionService     = interactionService;
            this.signingManagerProvider = signingManagerProvider;
            this.configurationService   = configurationService;
            this.fileViewer             = fileViewer;
            this.fileInvoker            = fileInvoker;

            eventAggregator.GetEvent <ToolsChangedEvent>().Subscribe(this.CreateTools, ThreadOption.UIThread);
        }
Пример #23
0
 public DependencyMapper(ISelfElevationProxyProvider <IAppxPackageManager> packageManager)
 {
     this.packageManager = packageManager;
 }
 public OpenEventViewerHandler(ISelfElevationProxyProvider <IAppxLogManager> logManagerProvider)
 {
     this.logManagerProvider = logManagerProvider;
 }
Пример #25
0
 public AppAttachManager(ISelfElevationProxyProvider <ISigningManager> managerFactory, IConfigurationService configurationService) : this(configurationService)
 {
     this.managerFactory = managerFactory;
 }
Пример #26
0
 public AppxVolumeManagerElevationProxy(IElevatedClient client, ISelfElevationProxyProvider <IAppxVolumeManager> volumeManagerFactory)
 {
     this.volumeManagerFactory = volumeManagerFactory;
     this.client = client;
 }
Пример #27
0
 public PackageExpertDialogViewModel(ISelfElevationProxyProvider <IAppxPackageInstaller> packageQueryInstaller)
 {
     this.packageQueryInstaller = packageQueryInstaller;
 }
Пример #28
0
 public GetLogsHandler(ISelfElevationProxyProvider <IAppxLogManager> logManagerProvider, IBusyManager busyManager)
 {
     this.logManagerProvider = logManagerProvider;
     this.busyManager        = busyManager;
 }
 public StopPackageHandler(ISelfElevationProxyProvider <IAppxPackageManager> packageManagerProvider)
 {
     this.packageManagerProvider = packageManagerProvider;
 }
Пример #30
0
 public PackageExpertDialogViewModel(ISelfElevationProxyProvider <IAppxPackageManager> packageManagerProvider)
 {
     this.packageManagerProvider = packageManagerProvider;
 }