/// <summary> /// 从保存此筛选器数据的 XML 文档节点集合初始化当前筛选器。 /// </summary> /// <param name="xmlNode">该对象节点的数据集合</param> public void SetFilterConfig(System.Xml.XmlNode xmlNode) { int intClassifyId = Function.ToInt(xmlNode.InnerText); AC.Base.ClassifySearchs.ClassifySearch _Search = new AC.Base.ClassifySearchs.ClassifySearch(this.m_Application); _Search.Filters.Add(new AC.Base.ClassifySearchs.IdFilter(intClassifyId)); foreach (Classify _Classify in _Search.Search()) { if (_Classify is CommonCustomClassify) { this.Classify = _Classify as CommonCustomClassify; AC.Base.Classify parent = this.Classify; while (parent != null) { this.FilterName = parent.Name; parent = parent.Parent; } } } }
/// <summary> /// 设置搜索筛选器。 /// </summary> /// <param name="filter">传入需要设置的搜索筛选器对象</param> public void SetFilter(IDeviceFilter filter) { this.m_Filter = filter as AC.Base.DeviceSearchs.CommonCustomClassifyFilter; this.labName.Text = this.m_Filter.FilterName + ":"; AC.Base.ClassifySearchs.ClassifySearch _Search = new AC.Base.ClassifySearchs.ClassifySearch(this.m_Application); _Search.Filters.Add(new AC.Base.ClassifySearchs.ParentIdFilter(0)); _Search.Filters.Add(new AC.Base.ClassifySearchs.ClassifyTypeFilter(typeof(CommonCustomClassify))); foreach (CommonCustomClassify _Classify in _Search.Search()) { if (_Classify.Name.Equals(this.m_Filter.FilterName)) { this.FillClassifys(_Classify.Children, ""); } } if (this.m_Filter.Classify == null) { this.m_Value.SelectedIndex = 0; } else { for (int intIndex = 1; intIndex < this.m_Value.Items.Count; intIndex++) { if (this.m_Value.Items[intIndex] is CommonCustomClassifyInfo) { CommonCustomClassifyInfo _Classify = this.m_Value.Items[intIndex] as CommonCustomClassifyInfo; if (_Classify.Classify.Equals(this.m_Filter.Classify)) { this.m_Value.SelectedIndex = intIndex; return; } } } this.m_Value.SelectedIndex = 0; } }