Compare() public static method

public static Compare ( Type firstType, Type secondType ) : bool
firstType System.Type
secondType System.Type
return bool
コード例 #1
0
ファイル: MethodComparer.cs プロジェクト: willyvasquezr/NCop
        public static bool MatchParameter(ParameterInfo firstParameter, ParameterInfo secondParameter)
        {
            var firstParameterType  = firstParameter.ParameterType;
            var secondParameterType = secondParameter.ParameterType;

            return(ReferenceEquals(firstParameterType, secondParameterType) || TypeComparer.Compare(firstParameterType, secondParameterType));
        }
コード例 #2
0
        public static bool IsMatchedTo(this PropertyInfo firstProperty, PropertyInfo secondProperty)
        {
            if (!firstProperty.Name.Equals(secondProperty.Name) || !MatchAccessModifier(firstProperty, secondProperty))
            {
                return(false);
            }

            return(ReferenceEquals(firstProperty.PropertyType, secondProperty.PropertyType) ||
                   TypeComparer.Compare(firstProperty.PropertyType, secondProperty.PropertyType));
        }
コード例 #3
0
ファイル: MethodComparer.cs プロジェクト: willyvasquezr/NCop
 public static bool MatchReturnType(Type firstReturnType, Type secondReturnType)
 {
     return(firstReturnType.Name.Equals(secondReturnType.Name) || TypeComparer.Compare(firstReturnType, secondReturnType));
 }