System.__Filters.FilterIgnoreCase C# (CSharp) Method

FilterIgnoreCase() private method

private FilterIgnoreCase ( MemberInfo m, Object filterCriteria ) : bool
m System.Reflection.MemberInfo
filterCriteria Object
return bool
        internal virtual bool FilterIgnoreCase(MemberInfo m,Object filterCriteria)
        {
            // Check that the criteria object is a String object
            if(filterCriteria == null || !(filterCriteria is String))
                throw new InvalidFilterCriteriaException(Environment.GetResourceString("RFLCT.FltCritString"));
    
            String str = (String) filterCriteria;
            str = str.Trim();
    
            String name = m.Name;
            // Get the nested class name only, as opposed to the mangled one
            if (m.MemberType == MemberTypes.NestedType) 
                name = name.Substring(name.LastIndexOf('+') + 1);
            // Check to see if this is a prefix or exact match requirement
            if (str.Length > 0 && str[str.Length - 1] == '*') {
                str = str.Substring(0, str.Length - 1);
                return (String.Compare(name,0,str,0,str.Length,StringComparison.OrdinalIgnoreCase)==0);
            }
    
            return (String.Compare(str,name, StringComparison.OrdinalIgnoreCase) == 0);
        }
    }