Checking CallingClass type (waiting resolving)
CallingClass is the type of a class containing the method or property. When its value is not “any”, the match method of the CallingClass must be following code:
public bool Match(Type type)
{
if (typeof(Any) == m_type)
return true;
else
{
if (type != null && m_type != null)
return (type.Name.Equals(m_type.Name));
else
return type.Equals(m_type);
}
}
Others has another expression:
public bool Match(Type type)
{
if (typeof(Any) == m_type)
return true;
else
return type.Equals(m_type);
}
Why must the first code segment use type.name to check whether they are different?