예제 #1
0
        /// <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);
        }
예제 #2
0
        /// <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)
                );
        }
예제 #3
0
 /// <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)
            );
 }
예제 #4
0
파일: TextRecord.cs 프로젝트: DM-TOR/nhin-d
        /// <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;
        }
예제 #5
0
파일: CertRecord.cs 프로젝트: DM-TOR/nhin-d
 /// <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)
            );
 }
예제 #6
0
 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);
 }
예제 #7
0
 /// <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);
 }