protected override bool ShouldFilter(string schemaKey, Dictionary <string, object> schemaData) { bool schemaKeyMatch = schemaKey.ToLower().Contains(filterText.ToLower()); bool fieldKeyMatch = !GDEItemManager.ShouldFilterByField(schemaKey, filterText); // Return if the schema keys don't contain the filter text or // if the schema fields don't contain the filter text if (!schemaKeyMatch && !fieldKeyMatch) { return(true); } return(false); }
protected override bool ShouldFilter(string itemKey, Dictionary <string, object> itemData) { if (itemData == null) { return(true); } string schemaType = "<unknown>"; object temp; if (itemData.TryGetValue(GDMConstants.SchemaKey, out temp)) { schemaType = temp as string; } // Return if we don't match any of the filter types if (GDEItemManager.FilterSchemaKeyArray.IsValidIndex(filterSchemaIndex) && !GDEItemManager.FilterSchemaKeyArray[filterSchemaIndex].Equals("_All") && !schemaType.Equals(GDEItemManager.FilterSchemaKeyArray[filterSchemaIndex])) { return(true); } bool schemaKeyMatch = schemaType.ToLower().Contains(filterText.ToLower()); bool fieldKeyMatch = !GDEItemManager.ShouldFilterByField(schemaType, filterText); bool itemKeyMatch = itemKey.ToLower().Contains(filterText.ToLower()); // Return if the schema keys don't contain the filter text or // if the schema fields don't contain the filter text if (!schemaKeyMatch && !fieldKeyMatch && !itemKeyMatch) { return(true); } return(false); }