コード例 #1
0
ファイル: DnsMessage.cs プロジェクト: andykernahan/ak-net-dns
 private static void Write(DnsQuestionCollection collection, IDnsWriter writer)
 {
     if (collection != null)
     {
         collection.Write(writer);
     }
 }
コード例 #2
0
        /// <summary>
        /// Returns a value indicating if the two collections are considered equal.
        /// </summary>
        /// <param name="left">The first collection.</param>
        /// <param name="right">The second collection.</param>
        /// <returns><see langword="true"/> if the collections are considered equal,
        /// otherwise; <see langword="false"/>.</returns>
        public static bool Equals(DnsQuestionCollection left, DnsQuestionCollection right)
        {
            if (left == right)
            {
                return(true);
            }
            if (left == null || right == null)
            {
                return(false);
            }
            if (left.Count != right.Count)
            {
                return(false);
            }

            for (int i = 0; i < left.Count; ++i)
            {
                if (!left[i].Equals(right[i]))
                {
                    return(false);
                }
            }

            return(true);
        }