public DirectoryItemPresentationCoordinator(UINavigationController controller, FileSpecifications fileSpecifications, Configuration configuration, IFileService <object> fileService) { _navigationController = controller; _fileSpecifications = fileSpecifications; _configuration = configuration; _fileService = fileService; }
public DirectoryContentViewModel(LoadedItem <object> loadedDirectoryItem, FileSpecifications fileSpecifications, Configuration configuration, IFileService <object> fileService) { url = loadedDirectoryItem.Url; _fileSpecifications = fileSpecifications; this.configuration = configuration; _fileService = fileService; var filterConfig = configuration.FilteringConfiguration; var allItems = loadedDirectoryItem.Resource as IEnumerable <Item <object> >; bool hasAnyFileFIlters = filterConfig.FileFilters.Any(); _allItems = allItems.Where( x => !hasAnyFileFIlters || filterConfig.FileFilters.Any(filter => filter.MatchesItem <object>(x))).ToList(); _itemsToDisplay = DirectoryContentViewModel.GetItemsWithAppliedFilterAndSortCriterias(string.Empty, SortMode, _allItems).ToList(); NSNotificationCenter.DefaultCenter.AddObserver(new NSString("ItemsDeleted"), notifiaction => { var deletedItems = notifiaction.Object as IEnumerable <Item <object> >; if (deletedItems == null) { return; } foreach (var deletedItem in deletedItems) { Remove(deletedItem); } Delegate?.ListChanged(this); }); }
public DirectoryViewModel(NSUrl url, LoadedItem <object> loadedDirectoryItem, FileSpecifications fileSpecifications, Configuration configuration, bool finishButtonHidden) { this.url = url; this.item = loadedDirectoryItem; this.fileSpecifications = fileSpecifications; this.configuration = configuration; this.FinishButtonHidden = finishButtonHidden; }
public FileItemPresentationCoordinator(UINavigationController navigationController, Item <object> item, FileSpecifications fileSpecifications, IFileService <object> fileService = null) { if (fileService == null) { fileService = new LocalStorageFileService <object>(); } this.navigationController = navigationController; this.fileService = fileService; this.fileSpecifications = fileSpecifications; this.item = item; }
public void Start(Item <object> item, FileSpecifications fileSpecifications, Configuration configuration, bool animated) { this.configuration = configuration; this.fileSpecifications = fileSpecifications; switch (item.Type) { case ItemType.Directory: var coordinator = new DirectoryItemPresentationCoordinator(_navigationController, fileSpecifications, configuration); coordinator.Delegate = this; coordinator.Start(item.Url, animated); _coordinators.Add(item); break; case ItemType.File: var fileCoordinator = new FileItemPresentationCoordinator(_navigationController, item, fileSpecifications); fileCoordinator.Start(animated); _coordinators.Add(fileCoordinator); break; } }
public override void ViewWillAppear(bool animated) { base.ViewWillAppear(animated); var fileSpecifications = new FileSpecifications(); var actionsConfiguration = new ActionsConfiguration() { CanRemoveFiles = CanRemoveFiles, CanRemoveDirectories = CanRemoveDirectories, CanChooseDirectories = CanChooseDirectories, CanChooseFiles = CanChooseFiles, AllowsMultipleSelection = AllowsMultipleSelection }; var filteringConfiguration = new FilteringConfiguration() { FileFilters = FileFilters, IgnoredFileFilters = IgnoredFileFilters }; var configuration = new Configuration() { ActionsConfiguration = actionsConfiguration, FilteringConfiguration = filteringConfiguration }; var itemToExplore = Item <object> .At(InitialDirectoryOfUrl, isDirectory : true); if (itemToExplore != null) { itemPresentationCoordinator.Start(itemToExplore, fileSpecifications, configuration, false); } else { throw new InvalidOperationException("Passed url is incorrect."); } }
public DirectoryContentViewModel(LoadedItem <object> loadedDirectoryItem, FileSpecifications fileSpecifications, Configuration configuration) : this(loadedDirectoryItem, fileSpecifications, configuration, new LocalStorageFileService <object>()) { }
internal void RemoveFileSpecification(string fileSpecification) { FileSpecifications.Remove(fileSpecification); Save(); }
internal void AddFileSpecification(string fileSpecification) { FileSpecifications.Add(fileSpecification); Save(); }
public DirectoryItemPresentationCoordinator(UINavigationController controller, FileSpecifications fileSpecifications, Configuration configuration) : this(controller, fileSpecifications, configuration, new LocalStorageFileService <object>()) { }