コード例 #1
0
            public override bool Equals(object obj)
            {
                Good7 rhs = obj as Good7;

                if ((object)rhs == null)
                {
                    return(false);
                }

                return(this == rhs);
            }
コード例 #2
0
            public override bool Equals(object rhsObj)
            {
                if (rhsObj == null)
                {
                    return(false);
                }

                Good7 rhs = rhsObj as Good7;

                return(DoIsEquals(rhs));                                // calls an instance method
            }
            public override bool Equals(object rhsObj)
            {
                if (rhsObj == null)
                {
                    return(false);
                }

                if (GetType() != rhsObj.GetType())
                {
                    return(false);
                }

                Good7 rhs = (Good7)rhsObj;                              // OK because of the GetType call

                return(x == rhs.x && y == rhs.y);
            }
コード例 #4
0
 public bool Equals(Good7 rhs)
 {
     return x == rhs.x && y == rhs.y;
 }
コード例 #5
0
 private bool DoIsEquals(Good7 rhs)
 {
     return m_name == rhs.m_name && m_address == rhs.m_address;
 }
コード例 #6
0
 private bool DoIsEquals(Good7 rhs)
 {
     return(m_name == rhs.m_name && m_address == rhs.m_address);
 }
コード例 #7
0
 public bool Equals(Good7 rhs)
 {
     return(x == rhs.x && y == rhs.y);
 }