コード例 #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
ファイル: DnsResourceRecord.cs プロジェクト: DM-TOR/nhin-d
 /// <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
ファイル: DnsRecordTable.cs プロジェクト: DM-TOR/nhin-d
 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
ファイル: AddressRecord.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;
     }
     
     AddressRecord addressRecord = record as AddressRecord;
     if (addressRecord == null)
     {
         return false;
     }
     
     return (this.Address == addressRecord.Address);
 }