CSharp examples for System.Collections:ICollection
add non exist element to ICollection
using System.Collections; using System;//from w w w . ja va 2s . com public class Main{ public static bool add(ICollection list, object value) { if (!((IList) list).Contains(value)) { ((IList) list).Add(value); return true; } else return false; } }