System.Reflection.__Filters.FilterTypeNameIgnoreCase C# (CSharp) Method

FilterTypeNameIgnoreCase() public method

public FilterTypeNameIgnoreCase ( Type cls, Object filterCriteria ) : bool
cls System.Type
filterCriteria Object
return bool
    	public virtual bool FilterTypeNameIgnoreCase(Type cls, Object filterCriteria)
    	{
    		// Check that the criteria object is a String object
    		if(filterCriteria == null || !(filterCriteria is String))
    			throw new InvalidFilterCriteriaException(System.Environment.GetResourceString("RFLCT.FltCritString"));
    
    		String str = (String) filterCriteria;
    		//str = str.Trim();
    
    		// 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);
                            String name = cls.Name;
							if (name.Length >= str.Length)
								return (String.Compare(name,0,str,0,str.Length,StringComparison.OrdinalIgnoreCase)==0);
							else
								return false;
    		}
    		return (String.Compare(str,cls.Name, StringComparison.OrdinalIgnoreCase) == 0);
    	}
    }