public void RemoveFilterInstance(IFilterInstance instance) { this.filterInstances.Remove(instance); for (int i = 0; i < this.filterInstances.Count; i++) { if (this.filterInstances[i].FamilyMask == instance.FamilyMask && this.filterInstances[i].FilterLevel > instance.FilterLevel && this.filterInstances[i].CheckFilterRequirements(this) == false) { this.filterInstances.RemoveAt(i); --i; } } this.RefreshResult(); }
private bool IdentifyFilter(string keywords) { string lowerKeywords = keywords.ToLower(); for (int i = 0; i < this.availableFilters.Count; i++) { IFilterInstance instance = this.availableFilters[i].Identify(this, keywords, lowerKeywords); if (instance != null) { this.filterInstances.Add(instance); return(true); } } return(false); }