private void SaveFilter(string filter) { if (string.IsNullOrEmpty(filter)) { this.filterString = string.Empty; this.doesPatternMatch = null; } else { this.filterString = filter; if (Utils.DoesNameContainWildCards(this.filterString)) { this.doesPatternMatch = doesWildcardPatternMatch; } else { this.doesPatternMatch = NameMatchesNoWildcardFilter; } if (this.IsCurrentValid && this.IsCurrentHidden()) { this.MoveNext(); } } }
/// <summary> /// Sets the pattern matching delegate that will be used for file name comparisons /// </summary> /// <param name="patternMatcher">FileNamePatternMatcher to be used by ActiveEnumeration</param> public static void SetPatternMatcher(FileNamePatternMatcher patternMatcher) { doesPatternMatch = patternMatcher; }
/// <summary> /// Sets the pattern matching delegate that will be used for file name comparisons when the filter /// contains wildcards. /// </summary> /// <param name="patternMatcher">FileNamePatternMatcher to be used by ActiveEnumeration</param> public static void SetWildcardPatternMatcher(FileNamePatternMatcher patternMatcher) { doesWildcardPatternMatch = patternMatcher; }