/// <summary> /// Tests equality between this TXT record and the other <paramref name="record"/>. /// </summary> /// <param name="record">The other record.</param> /// <returns><c>true</c> if the RRs are equal, <c>false</c> otherwise.</returns> public override bool Equals(DnsResourceRecord record) { if (!base.Equals(record)) { return(false); } AddressRecord addressRecord = record as AddressRecord; if (addressRecord == null) { return(false); } return(this.Address == addressRecord.Address); }
/// <summary> /// Tests equality between this CERT record and the other <paramref name="record"/>. /// </summary> /// <param name="record">The other record.</param> /// <returns><c>true</c> if the RRs are equal, <c>false</c> otherwise.</returns> public override bool Equals(DnsResourceRecord record) { if (!base.Equals(record)) { return(false); } CertRecord certRecord = record as CertRecord; if (certRecord == null) { return(false); } return( this.m_algorithm == certRecord.m_algorithm && this.m_certType == certRecord.m_certType && this.m_keyTag == certRecord.m_keyTag && DnsStandard.Equals(this.Cert.Name, certRecord.Cert.Name) ); }
/// <summary> /// Tests equality between this RR and the other <paramref name="record"/> /// </summary> /// <remarks> /// Compares all fields except TTL , since that can vary /// </remarks> /// <returns><c>true</c> if equal</returns> public virtual bool Equals(DnsResourceRecord record) { if (record == null) { return false; } return ( this.Type == record.Type && this.Class == record.Class && DnsStandard.Equals(this.Name, record.Name) ); }
/// <summary> /// Tests equality between this TXT record and the other <paramref name="record"/>. /// </summary> /// <param name="record">The other record.</param> /// <returns><c>true</c> if the RRs are equal, <c>false</c> otherwise.</returns> public override bool Equals(DnsResourceRecord record) { if (!base.Equals(record)) { return false; } TextRecord textRecord = record as TextRecord; if (textRecord == null) { return false; } if (this.HasStrings != textRecord.HasStrings || m_strings.Count != textRecord.Strings.Count) { return false; } for (int i = 0, count = m_strings.Count; i < count; ++i) { if (!string.Equals(m_strings[i], textRecord.Strings[i], StringComparison.Ordinal)) { return false; } } return true; }
/// <summary> /// Tests equality between this CERT record and the other <paramref name="record"/>. /// </summary> /// <param name="record">The other record.</param> /// <returns><c>true</c> if the RRs are equal, <c>false</c> otherwise.</returns> public override bool Equals(DnsResourceRecord record) { if (!base.Equals(record)) { return false; } CertRecord certRecord = record as CertRecord; if (certRecord == null) { return false; } return ( this.m_algorithm == certRecord.m_algorithm && this.m_certType == certRecord.m_certType && this.m_keyTag == certRecord.m_keyTag && DnsStandard.Equals(this.Cert.Name, certRecord.Cert.Name) ); }
public void Add(DnsResourceRecord record) { if (record == null) { throw new ArgumentNullException(); } DnsResourceRecordCollection recordList; if (!m_records.TryGetValue(record.Name, out recordList)) { recordList = new DnsResourceRecordCollection(); m_records.Add(record.Name, recordList); } recordList.Add(record); }
/// <summary> /// Tests equality between this TXT record and the other <paramref name="record"/>. /// </summary> /// <param name="record">The other record.</param> /// <returns><c>true</c> if the RRs are equal, <c>false</c> otherwise.</returns> public override bool Equals(DnsResourceRecord record) { if (!base.Equals(record)) { return false; } AddressRecord addressRecord = record as AddressRecord; if (addressRecord == null) { return false; } return (this.Address == addressRecord.Address); }