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

FilterTypeName() public method

public FilterTypeName ( Type cls, Object filterCriteria ) : bool
cls System.Type
filterCriteria Object
return bool
    	public virtual bool FilterTypeName(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);
    			return cls.Name.StartsWith(str, StringComparison.Ordinal);
    		}
    
    		return cls.Name.Equals(str);
    	}