CSharp examples for System.Collections:IDictionary
singleton Map
using System.Collections; using System;/*from w w w . j a v a 2 s . c o m*/ public class Main{ public static IDictionary singletonMap(object key, object value) { IDictionary dictionary = new Hashtable(); dictionary.Add(key, value); return dictionary; } public static bool add(ICollection list, object value) { if (!((IList) list).Contains(value)) { ((IList) list).Add(value); return true; } else return false; } }