CSharp examples for System.Collections.Generic:ICollection
Collection Equals
using System.Collections; using System;/* w ww.jav a 2 s .c om*/ public class Main{ public static bool CollectionEquals( ICollection c1, ICollection c2 ) { if( c1 == c2 ) { return true; } if( c1.Count != c2.Count ) { return false; } IEnumerator e1 = c1.GetEnumerator(); IEnumerator e2 = c2.GetEnumerator(); while( e1.MoveNext() ) { e2.MoveNext(); if( !object.Equals( e1.Current, e2.Current ) ) { return false; } } return true; } }