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)); }
public SidebarView(IBusyManager busyManager) { this.busyManager = busyManager; this.InitializeComponent(); this.busyManager.StatusChanged += this.OnBusyManagerStatusChanged; }
public PackagesListViewModel( IBusyManager busyManager, IMsixHeroApplication application, IInteractionService interactionService) { this.busyManager = busyManager; this.application = application; this.interactionService = interactionService; this.Items = new ObservableCollection <InstalledPackageViewModel>(); this.ItemsCollection = CollectionViewSource.GetDefaultView(this.Items); this.ItemsCollection.Filter = row => this.IsPackageVisible((InstalledPackageViewModel)row); // reloading packages this.application.EventAggregator.GetEvent <UiExecutingEvent <GetPackagesCommand> >().Subscribe(this.OnGetPackagesExecuting); this.application.EventAggregator.GetEvent <UiExecutedEvent <GetPackagesCommand, IList <InstalledPackage> > >().Subscribe(this.OnGetPackagesExecuted, ThreadOption.UIThread); this.application.EventAggregator.GetEvent <UiFailedEvent <GetPackagesCommand> >().Subscribe(this.OnGetPackagesFailed); this.application.EventAggregator.GetEvent <UiCancelledEvent <GetPackagesCommand> >().Subscribe(this.OnGetPackagesCancelled); // filtering this.application.EventAggregator.GetEvent <UiExecutedEvent <SetPackageFilterCommand> >().Subscribe(this.OnSetPackageFilterCommand, ThreadOption.UIThread); // sorting ang grouping this.application.EventAggregator.GetEvent <UiExecutedEvent <SetPackageSortingCommand> >().Subscribe(this.OnSetPackageSorting, ThreadOption.UIThread); this.application.EventAggregator.GetEvent <UiExecutedEvent <SetPackageGroupingCommand> >().Subscribe(this.OnSetPackageGrouping, ThreadOption.UIThread); // is running indicator this.application.EventAggregator.GetEvent <PubSubEvent <ActivePackageFullNames> >().Subscribe(this.OnActivePackageIndication); this.application.EventAggregator.GetEvent <PubSubEvent <ActivePackageFullNames> >().Subscribe(this.OnActivePackageIndicationFinished, ThreadOption.UIThread); this.busyManager.StatusChanged += BusyManagerOnStatusChanged; this.SetSortingAndGrouping(); }
public VolumesSearchViewModel( IMsixHeroApplication application, IBusyManager busyManager, IInteractionService interactionService) { this.application = application; this.busyManager = busyManager; this.interactionService = interactionService; this.application.EventAggregator.GetEvent <UiExecutedEvent <SetVolumeFilterCommand> >().Subscribe(this.OnSetVolumeFilterCommand); }
public GetVolumesHandler( IMsixHeroCommandExecutor commandExecutor, ISelfElevationProxyProvider <IAppxVolumeManager> volumeManagerProvider, IBusyManager busyManager, IConfigurationService configurationService) { this.commandExecutor = commandExecutor; this.configurationService = configurationService; this.volumeManagerProvider = volumeManagerProvider; this.busyManager = busyManager; }
public EventViewerCommandHandler( UIElement parent, IMsixHeroApplication application, IInteractionService interactionService, IBusyManager busyManager) { this.application = application; this.interactionService = interactionService; this.busyManager = busyManager; parent.CommandBindings.Add(new CommandBinding(NavigationCommands.Refresh, this.OnRefresh, this.CanRefresh)); parent.CommandBindings.Add(new CommandBinding(ApplicationCommands.Copy, this.OnCopy, this.CanCopy)); }
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; }
public PackagesSearchViewModel( IEventAggregator eventAggregator, IMsixHeroApplication application, IBusyManager busyManager, IInteractionService interactionService) { this.application = application; this.busyManager = busyManager; this.interactionService = interactionService; this.application.EventAggregator.GetEvent <UiExecutedEvent <SetPackageFilterCommand> >().Subscribe(this.OnSetPackageFilterCommand); this.isAllUsers = application.ApplicationState.Packages.Mode == PackageContext.AllUsers; eventAggregator.GetEvent <UiExecutedEvent <GetPackagesCommand> >().Subscribe(this.OnGetPackages); eventAggregator.GetEvent <UiFailedEvent <GetPackagesCommand> >().Subscribe(this.OnGetPackages); eventAggregator.GetEvent <UiCancelledEvent <GetPackagesCommand> >().Subscribe(this.OnGetPackages); }
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); }
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); }
public VolumesListViewModel( IMsixHeroApplication application, IBusyManager busyManager, IInteractionService interactionService) { this.busyManager = busyManager; this.application = application; this.interactionService = interactionService; this.Items = new ObservableCollection <VolumeViewModel>(); this.ItemsCollection = CollectionViewSource.GetDefaultView(this.Items); this.ItemsCollection.Filter = row => this.IsVolumeVisible((VolumeViewModel)row); this.application.EventAggregator.GetEvent <UiExecutingEvent <GetVolumesCommand> >().Subscribe(this.OnGetVolumesExecuting); this.application.EventAggregator.GetEvent <UiExecutedEvent <GetVolumesCommand, IList <AppxVolume> > >().Subscribe(this.OnGetVolumesExecuted, ThreadOption.UIThread); this.application.EventAggregator.GetEvent <UiFailedEvent <GetVolumesCommand> >().Subscribe(this.OnGetVolumesFailed); this.application.EventAggregator.GetEvent <UiCancelledEvent <GetVolumesCommand> >().Subscribe(this.OnGetVolumesCancelled); // filtering this.application.EventAggregator.GetEvent <UiExecutedEvent <SetVolumeFilterCommand> >().Subscribe(this.OnSetVolumeFilterCommand, ThreadOption.UIThread); this.busyManager.StatusChanged += BusyManagerOnStatusChanged; }
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); }
public EventViewerListViewModel( IMsixHeroApplication application, IBusyManager busyManager, IInteractionService interactionService) { this.application = application; this.busyManager = busyManager; this.interactionService = interactionService; this.Logs = new ObservableCollection <LogViewModel>(); this.LogsView = CollectionViewSource.GetDefaultView(this.Logs); this.LogsView.Filter += Filter; this.Sort(nameof(Log.DateTime), false); this.MaxLogs = 250; this.End = DateTime.Now; this.Start = this.End.Subtract(TimeSpan.FromDays(5)); this.busyManager.StatusChanged += BusyManagerOnStatusChanged; this.Progress = new ProgressProperty(); this.application.EventAggregator.GetEvent <UiExecutedEvent <GetLogsCommand, IList <Log> > >().Subscribe(this.OnGetLogs, ThreadOption.UIThread); this.application.EventAggregator.GetEvent <UiExecutedEvent <SetEventViewerFilterCommand> >().Subscribe(this.OnSetEventViewerFilterCommand, ThreadOption.UIThread); this.application.EventAggregator.GetEvent <UiExecutedEvent <SetEventViewerSortingCommand> >().Subscribe(this.OnSetEventViewerSortingCommand, ThreadOption.UIThread); this.SetSortingAndGrouping(); }
public GetLogsHandler(ISelfElevationProxyProvider <IAppxLogManager> logManagerProvider, IBusyManager busyManager) { this.logManagerProvider = logManagerProvider; this.busyManager = busyManager; }
public EventViewerView(IMsixHeroApplication application, IInteractionService interactionService, IBusyManager busyManager) { this.application = application; this.InitializeComponent(); this.commandHandler = new EventViewerCommandHandler(this, application, interactionService, busyManager); }
public static IMsixHeroCommandExecutor WithBusyManager(this IMsixHeroCommandExecutor executor, IBusyManager busyManager, OperationType operationType) { return(MsixHeroDecoratedCommandExecutor.From(executor, busyManager, operationType)); }
public MsixHeroDecoratedCommandExecutor(IMsixHeroCommandExecutor decorated, IBusyManager manager, OperationType operation) : this(decorated) { this.busyManager = manager; this.operationType = operation; }
private MsixHeroDecoratedCommandExecutor(IMsixHeroCommandExecutor commandExecutor, IBusyManager manager, OperationType operation) : this(commandExecutor) { this.busyManager = manager; this.operationType = operation; }
public static MsixHeroDecoratedCommandExecutor From(IMsixHeroCommandExecutor executor, IBusyManager busyManager, OperationType operationType) { var result = executor as MsixHeroDecoratedCommandExecutor; if (result == null) { result = new MsixHeroDecoratedCommandExecutor(executor, busyManager, operationType); } else { result.busyManager = busyManager; result.operationType = operationType; } return(result); }