Exemplo n.º 1
0
        public ILayerFeatureFilterComparer GetFilterComparer()
        {
            ILayerFeatureFilterComparer filterComparer = new LayerFilterComparer();

            switch (filterOperator)
            {
            case LayerFilterOperationType.IsEqual:
                filterComparer = LayerFilterComparer.HasPropertyIsEqual(Key, Min);
                break;

            case LayerFilterOperationType.IsGreater:
                filterComparer = LayerFilterComparer.HasPropertyGreaterThan(Key, Min);
                break;

            case LayerFilterOperationType.IsLess:
                filterComparer = LayerFilterComparer.HasPropertyLessThan(Key, Min);
                break;

            case LayerFilterOperationType.Contains:
                filterComparer = LayerFilterComparer.PropertyContainsValue(Key, PropertyValue.Split(','));
                break;

            case LayerFilterOperationType.IsInRange:
                filterComparer = LayerFilterComparer.HasPropertyInRange(Key, Min, Max);
                break;

            default:
                break;
            }
            return(filterComparer);
        }
Exemplo n.º 2
0
		public ILayerFeatureFilterComparer GetFilterComparer()
		{
			if (_delimiters == null)
			{
				_delimiters = new char[] { ',' };
			}
			ILayerFeatureFilterComparer filterComparer = new LayerFilterComparer();

			switch (filterOperator)
			{
				case LayerFilterOperationType.IsEqual:
					filterComparer = LayerFilterComparer.HasPropertyIsEqual(Key, Min);
					break;
				case LayerFilterOperationType.IsGreater:
					filterComparer = LayerFilterComparer.HasPropertyGreaterThan(Key, Min);
					break;
				case LayerFilterOperationType.IsLess:
					filterComparer = LayerFilterComparer.HasPropertyLessThan(Key, Min);
					break;
				case LayerFilterOperationType.Contains:
					var matchList = PropertyValue.ToLower()
						.Split(_delimiters, StringSplitOptions.RemoveEmptyEntries)
						.Select(p => p.Trim())
						.Where(p => !string.IsNullOrEmpty(p))
						.ToArray();
					filterComparer = LayerFilterComparer.PropertyContainsValue(Key, matchList);
					break;
				case LayerFilterOperationType.IsInRange:
					filterComparer = LayerFilterComparer.HasPropertyInRange(Key, Min, Max);
					break;
				default:
					break;
			}
			return filterComparer;
		}