private void PopulateProviders(ProvidersFilter Filter) { lvProviders.BeginUpdate(); lvProviders.Items.Clear(); bool bHasNameOrGuidFilter = !string.IsNullOrEmpty(Filter.ProviderString); foreach (XmlNode xnProv in Filter.Nodes.SelectNodes(string.Format("{0}", XML_PROVIDER))) { // Skip empty GUIDs string Guid = xnGetText(xnProv, string.Format("{0}/{1}", XML_METADATA, XML_GUID)); if (Guid == STR_NULL_GUID) { continue; } string Name = xnGetText(xnProv, XML_NAME); if (bHasNameOrGuidFilter && ((Name.IndexOf(Filter.ProviderString, StringComparison.OrdinalIgnoreCase) == -1) && (Guid.IndexOf(Filter.ProviderString, StringComparison.OrdinalIgnoreCase) == -1) ) ) { continue; } var lvi = new ListViewItem(Guid); lvi.SubItems.Add(Name); lvProviders.Items.Add(lvi); lvi.Tag = Name; } lvProviders.EndUpdate(); }
private void WEPExplorerForm_Load( object sender, EventArgs e) { Text = STR_TITLE; cbProviderMetadataTemplateFieldsMatchCondition.SelectedIndex = 0; CreateCommonMenuItems( ctxmenuProviders, lvProviders, CtxMenuFlags.AllNoDelete); CreateCommonMenuItems( ctxmenuProvKeywords, lvProviderKeywords, CtxMenuFlags.AllNoDelete); CreateCommonMenuItems( ctxmenuProvMetadata, lvProviderMetadata); // Populate providers LastProvidersFilter = new ProvidersFilter(); GetProviders(out LastProvidersFilter.Nodes); PopulateProviders(LastProvidersFilter); }
private void PopulateProviders(ProvidersFilter Filter) { lvProviders.BeginUpdate(); lvProviders.Items.Clear(); bool bHasNameOrGuidFilter = !string.IsNullOrEmpty(Filter.ProviderString); foreach (XmlNode xnProv in Filter.Nodes.SelectNodes(string.Format("{0}", XML_PROVIDER))) { // Skip empty GUIDs string Guid = xnGetText(xnProv, string.Format("{0}/{1}", XML_METADATA, XML_GUID)); if (Guid == STR_NULL_GUID) continue; string Name = xnGetText(xnProv, XML_NAME); if (bHasNameOrGuidFilter && ( (Name.IndexOf(Filter.ProviderString, StringComparison.OrdinalIgnoreCase) == -1) && (Guid.IndexOf(Filter.ProviderString, StringComparison.OrdinalIgnoreCase) == -1) ) ) { continue; } var lvi = new ListViewItem(Guid); lvi.SubItems.Add(Name); lvProviders.Items.Add(lvi); lvi.Tag = Name; } lvProviders.EndUpdate(); }
private void WEPExplorerForm_Load( object sender, EventArgs e) { Text = STR_TITLE; cbProviderMetadataTemplateFieldsMatchCondition.SelectedIndex = 0; CreateCommonMenuItems( ctxmenuProviders, lvProviders, CtxMenuFlags.AllNoDelete); CreateCommonMenuItems( ctxmenuProvKeywords, lvProviderKeywords, CtxMenuFlags.AllNoDelete); CreateCommonMenuItems( ctxmenuProvMetadata, lvProviderMetadata); // Populate providers LastProvidersFilter = new ProvidersFilter(); GetProviders(out LastProvidersFilter.Nodes); PopulateProviders(LastProvidersFilter); }