public void PopulateCbChkTemplateFieldsFilter( PresentationControls.CheckBoxComboBox CbChk, XmlNode xnProvider) { CbChk.BeginUpdate(); CbChk.CheckBoxItems.Clear(); CbChk.Clear(); var AllFields = new HashSet <string>(); foreach (XmlNode xnTemplate in xnProvider.SelectNodes(string.Format("{0}/{1}/{2}/{3}", XML_PROVIDER, XML_EVENT_METADATA, XML_EVENT, XML_TEMPLATE))) { foreach (string Field in GetProviderTemplateFields(xnTemplate.InnerText)) { AllFields.Add(Field); } } var SortedFields = new List <string>(AllFields); SortedFields.Sort(); foreach (string Field in SortedFields) { if (!string.IsNullOrEmpty(Field)) { CbChk.Items.Add(Field); } } CbChk.Text = ""; CbChk.EndUpdate(); }
public void PopulateCbChkFilters( PresentationControls.CheckBoxComboBox CbChk, XmlNodeList Nodes, string NodeName, string SecondaryNodeName = null) { CbChk.BeginUpdate(); CbChk.CheckBoxItems.Clear(); CbChk.Clear(); foreach (XmlNode xnNode in Nodes) { string Str = xnGetText(xnNode, NodeName); if (string.IsNullOrEmpty(Str) && SecondaryNodeName != null) { Str = xnGetText(xnNode, SecondaryNodeName); } if (!string.IsNullOrEmpty(Str)) { CbChk.Items.Add(Str); } } CbChk.Text = ""; CbChk.EndUpdate(); }