コード例 #1
0
        public bool MatchesFilter(DriverFilter filter)
        {
            switch (filter)
            {
            case DriverFilter.All:
                return(true);

            case DriverFilter.Create:
                return(!string.IsNullOrWhiteSpace(get_Metadata(GdalDriverMetadata.Create)));

            case DriverFilter.CreateCopy:
                return(!string.IsNullOrWhiteSpace(get_Metadata(GdalDriverMetadata.CreateCopy)));

            case DriverFilter.VirtualIo:
                return(!string.IsNullOrWhiteSpace(get_Metadata(GdalDriverMetadata.VirtualIo)));

            case DriverFilter.HasCreationOptions:
                return(!string.IsNullOrWhiteSpace(get_Metadata(GdalDriverMetadata.CreationOptionList)));

            case DriverFilter.HasOpenOptions:
                return(!string.IsNullOrWhiteSpace(get_Metadata(GdalDriverMetadata.OpenOptionList)));

            case DriverFilter.HasLayerCreationOptions:
                return(!string.IsNullOrWhiteSpace(get_Metadata(GdalDriverMetadata.LayerCreationOptionList)));
            }

            return(true);
        }
コード例 #2
0
        public async Task <IActionResult> ListAsync([ModelBinder(typeof(FilterModelBinder))] DriverFilter filter,
                                                    CancellationToken cancellationToken)
        {
            var result = await _driverService.ListAsync(filter, cancellationToken);

            return(result.GetActionResult(ActionResultFactory));
        }
コード例 #3
0
        public void Filter(string token, DriverFilter filter)
        {
            _filterToken  = token;
            _driverFilter = filter;

            BuildList();

            SelectFirstVisibleNode();
        }
コード例 #4
0
        public DriverListModel(MainViewModel mainModel)
        {
            _mainModel = mainModel;

            // Initialize views and filters
            _driversView      = (ListCollectionView)CollectionViewSource.GetDefaultView(Simulator.Instance.Drivers);
            _classFilterItems = new ObservableCollection <ClassFilterItem>();
            _classFilterItems.Add(ClassFilterItem.All());

            _driverFilter = new DriverFilter();
            _driverFilter.Attach(_driversView);
            _selectedDrivers = new ObservableCollection <DriverContainer>();
        }
コード例 #5
0
        public DriverListModel(MainViewModel mainModel)
        {
            _mainModel = mainModel;

            // Initialize views and filters                      
            _driversView = (ListCollectionView) CollectionViewSource.GetDefaultView(Simulator.Instance.Drivers);
            _classFilterItems = new ObservableCollection<ClassFilterItem>();
            _classFilterItems.Add(ClassFilterItem.All());

            _driverFilter = new DriverFilter();
            _driverFilter.Attach(_driversView);
            _selectedDrivers = new ObservableCollection<DriverContainer>();

            
        }