コード例 #1
0
 /// <summary>
 /// Tests if this PropertyOrField is a match for another
 /// </summary>
 /// <param name="master"></param>
 /// <param name="other"></param>
 /// <param name="mustMatchMemberType"></param>
 /// <returns></returns>
 public static bool IsMatchFor(
     this PropertyOrField master,
     PropertyOrField other,
     bool mustMatchMemberType
     )
 {
     return(master.Name == other.Name &&
            master.Type == other.Type &&
            master.AccessMatches(other) &&
            (!mustMatchMemberType || master.MemberType == other.MemberType));
 }
コード例 #2
0
        public static bool IsAssignmentMatchFor(
            this PropertyOrField master,
            PropertyOrField other,
            bool mustMatchMemberType
            )
        {
#pragma warning disable S1067
            return(master.Name == other.Name &&
                   other.Type.IsAssignableOrUpcastableTo(master.Type) &&
                   master.AccessMatches(other) &&
                   (!mustMatchMemberType || master.MemberType == other.MemberType));

#pragma warning restore S1067
        }