Click or drag to resize
FilterItem 类
该类定义了过滤信息 如果该过滤器是Single类型,那么过滤器的"FilterOn"和"FilterValues"会被使用,"Children"和"ConcatType"会被忽略, 如果该过滤器是Group类型,那么"Children"和"ConcatType"会被使用,"FilterOn"和"FilterValues"会被忽略, 该类型最终会形成一个树形的结构。
继承层次结构
SystemObject
  Gridsum.Common.QueryIntegrationFilterItem

命名空间: Gridsum.Common.QueryIntegration
程序集: Gridsum.Common.QueryIntegration (in Gridsum.Common.QueryIntegration.dll) 版本: 1.1.6002.25690 (1.1.0.0)
语法
[SerializableAttribute]
public class FilterItem : IFilter

该类型:FilterItem暴露了以下成员:

构造函数
  名称说明
公共方法FilterItem
Top
方法
  名称说明
公共方法Equals
Determines whether the specified Object is equal to the current Object.
(继承自 Object.)
保护方法Finalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(继承自 Object.)
公共方法GetHashCode
Serves as a hash function for a particular type.
(继承自 Object.)
公共方法GetType
Gets the Type of the current instance.
(继承自 Object.)
保护方法MemberwiseClone
Creates a shallow copy of the current Object.
(继承自 Object.)
公共方法ToString
Returns a string that represents the current object.
(继承自 Object.)
Top
扩展 方法
  名称说明
公共扩展方法ToScript
根据传递的键名对,生成相应的过滤脚本
(定义如下 FilterExtension.)
公共扩展方法Validate
验证过滤器是否正确
(定义如下 FilterExtension.)
Top
属性
  名称说明
公共属性Children
获取或设置子过滤器FilterItem
公共属性ConcatType
获取或设置过滤器间ConcatType,该属性只有在过滤类型为分组的时候被使用
公共属性FilterItemType
获取或设置FilterItemType信息
公共属性FilterOn
获取或设置过滤的列,该列必须是元数据中的列的键
公共属性FilterType
获取或设置FilterType信息
公共属性FilterValues
获取或设置过滤器的数据,该数据只有过滤类型为单一类型的时候
公共属性Options
获取或设置额外的参数信息
Top
示例
C#
FilterItem filter = new FilterItem();
filter.FilterItemType = FilterItemType.Group;
filter.ConcatType = ConcatType.And; 
filter.Children = new List<FilterItem>();

FilterItem advertiserChild = new FilterItem();
advertiserChild.FilterItemType = FilterItemType.Single;
advertiserChild.FilterOn = "Advertiser.AdvertiserId";
advertiserChild.FilterType = FilterType.Equal;
advertiserChild.FilterValues = new object[]{1};
filter.Children.Add(advertiserChild);

FilterItem statusChild = new FilterItem();
statusChild.FilterItemType = FilterItemType.Single;
statusChild.FilterOn = "Campaign.Status";
statusChild.FilterType = FilterType.Equal;
statusChild.FilterValues = new object[]{"Active"};
filter.Children.Add(statusChild);
参见