public PathReferenceCountUpdateWhenSourceManagementChanged( IEventAggregator eventAggregator, SearchIndexUpdateProcessSettings settings, StorageItemSearchManager storageItemSearchManager, SourceStorageItemsRepository sourceStorageItemsRepository, PathReferenceCountManager PathReferenceCountManager ) { _eventAggregator = eventAggregator; _settings = settings; _storageItemSearchManager = storageItemSearchManager; _sourceStorageItemsRepository = sourceStorageItemsRepository; _PathReferenceCountManager = PathReferenceCountManager; _ProgressEvent = _eventAggregator.GetEvent <SearchIndexUpdateProgressEvent>(); _eventAggregator.GetEvent <SourceStorageItemsRepository.AddedEvent>() .Subscribe(async args => { if (args.StorageItem is StorageFolder) { RegistrationUpdateIndex(args.Token); } else { using (await _lock.LockAsync(default))
public SearchResultPageViewModel( StorageItemSearchManager storageItemSearchManager, SourceStorageItemsRepository sourceStorageItemsRepository, PathReferenceCountManager PathReferenceCountManager, FolderListingSettings folderListingSettings, BookmarkManager bookmarkManager, ThumbnailManager thumbnailManager, SecondaryTileManager secondaryTileManager, OpenFolderItemCommand openFolderItemCommand, OpenImageViewerCommand openImageViewerCommand, OpenFolderListupCommand openFolderListupCommand, OpenWithExplorerCommand openWithExplorerCommand, SecondaryTileAddCommand secondaryTileAddCommand, SecondaryTileRemoveCommand secondaryTileRemoveCommand ) { _storageItemSearchManager = storageItemSearchManager; _sourceStorageItemsRepository = sourceStorageItemsRepository; _PathReferenceCountManager = PathReferenceCountManager; _folderListingSettings = folderListingSettings; _bookmarkManager = bookmarkManager; _thumbnailManager = thumbnailManager; SecondaryTileManager = secondaryTileManager; OpenFolderItemCommand = openFolderItemCommand; OpenImageViewerCommand = openImageViewerCommand; OpenFolderListupCommand = openFolderListupCommand; OpenWithExplorerCommand = openWithExplorerCommand; SecondaryTileAddCommand = secondaryTileAddCommand; SecondaryTileRemoveCommand = secondaryTileRemoveCommand; }
public ApplicationDataUpdateWhenPathReferenceCountChanged( IEventAggregator eventAggregator, RecentlyAccessManager recentlyAccessManager, BookmarkManager bookmarkManager, StorageItemSearchManager storageItemSearchManager, FolderContainerTypeManager folderContainerTypeManager, ThumbnailManager thumbnailManager, SecondaryTileManager secondaryTileManager, FolderLastIntractItemManager folderLastIntractItemManager ) { _eventAggregator = eventAggregator; _recentlyAccessManager = recentlyAccessManager; _bookmarkManager = bookmarkManager; _storageItemSearchManager = storageItemSearchManager; _folderContainerTypeManager = folderContainerTypeManager; _thumbnailManager = thumbnailManager; _folderLastIntractItemManager = folderLastIntractItemManager; _eventAggregator.GetEvent <PathReferenceCountManager.PathReferenceAddedEvent>() .Subscribe(args => { } , keepSubscriberReferenceAlive: true ) .AddTo(_disposables); _eventAggregator.GetEvent <PathReferenceCountManager.PathReferenceRemovedEvent>() .Subscribe(async args => { _recentlyAccessManager.Delete(args.Path); _bookmarkManager.RemoveBookmark(args.Path); _storageItemSearchManager.Remove(args.Path); _folderContainerTypeManager.Delete(args.Path); _folderLastIntractItemManager.Remove(args.Path); await _thumbnailManager.DeleteFromPath(args.Path); await secondaryTileManager.RemoveSecondaryTile(args.Path); } , keepSubscriberReferenceAlive: true ) .AddTo(_disposables); }
public PrimaryWindowCoreLayoutViewModel( [Dependency("PrimaryWindowNavigationService")] Lazy <INavigationService> navigationServiceLazy, IEventAggregator eventAggregator, IScheduler scheduler, ApplicationSettings applicationSettings, RestoreNavigationManager restoreNavigationManager, SourceStorageItemsRepository sourceStorageItemsRepository, PathReferenceCountManager PathReferenceCountManager, FolderContainerTypeManager folderContainerTypeManager, StorageItemSearchManager storageItemSearchManager, SourceChoiceCommand sourceChoiceCommand, RefreshNavigationCommand refreshNavigationCommand, OpenPageCommand openPageCommand ) { MenuItems = new List <object> { new MenuItemViewModel() { PageType = nameof(Views.SourceStorageItemsPage) }, //new MenuItemViewModel() { PageType = nameof(Views.CollectionPage) }, }; _navigationServiceLazy = navigationServiceLazy; EventAggregator = eventAggregator; _scheduler = scheduler; ApplicationSettings = applicationSettings; RestoreNavigationManager = restoreNavigationManager; SourceStorageItemsRepository = sourceStorageItemsRepository; _PathReferenceCountManager = PathReferenceCountManager; _folderContainerTypeManager = folderContainerTypeManager; _storageItemSearchManager = storageItemSearchManager; SourceChoiceCommand = sourceChoiceCommand; SourceChoiceCommand.OpenAfterChoice = true; RefreshNavigationCommand = refreshNavigationCommand; OpenPageCommand = openPageCommand; UpdateAutoSuggestCommand = new ReactiveCommand <string>(); UpdateAutoSuggestCommand .Throttle(TimeSpan.FromSeconds(0.250), _scheduler) .Subscribe(ExecuteUpdateAutoSuggestCommand) .AddTo(_disposables); EventAggregator.GetEvent <PathReferenceCountUpdateWhenSourceManagementChanged.SearchIndexUpdateProgressEvent>() .Subscribe(args => { _autoSuggestBoxSearchIndexGroup.SearchIndexUpdateProgressCount = args.ProcessedCount; _autoSuggestBoxSearchIndexGroup.SearchIndexUpdateTotalCount = args.TotalCount; Debug.WriteLine($"[SearchIndexUpdate] progress: {args.ProcessedCount}/{args.TotalCount} "); } , ThreadOption.UIThread , keepSubscriberReferenceAlive: true ) .AddTo(_disposables); AutoSuggestBoxItems = new[] { _AutoSuggestItemsGroup, _autoSuggestBoxSearchIndexGroup }; }