public bool Equals(InfoBlock infoBlock) { if (Object.ReferenceEquals(null, infoBlock)) { return(false); } // Is the same object? if (Object.ReferenceEquals(this, infoBlock)) { return(true); } return(IsEqual(infoBlock)); }
bool IsEqual(InfoBlock infoBlock) { if (m_iIPversion != infoBlock.m_iIPversion) { return(false); } else if (m_iIPversion == AddressFamily.InterNetwork) { return(m_piIP[0] == infoBlock.m_piIP[0]); } for (int i = 0; i < 4; ++i) { if (m_piIP[i] != infoBlock.m_piIP[i]) { return(false); } } return(true); }