CSharp examples for System.Collections.Generic:List
singleton List
using System.Collections; using System;/* w w w . j a v a2 s .co m*/ public class Main{ public static IList singletonList(object obj) { IList list = new ArrayList(); list.Add(obj); return list; } public static bool add(ICollection list, object value) { if (!((IList) list).Contains(value)) { ((IList) list).Add(value); return true; } else return false; } }