/// <summary> /// Remove the specified object. /// </summary> /// <returns><c>true</c>, if the object was in the dictionary and could be removed, <c>false</c> otherwise.</returns> /// <param name="obj">Object.</param> public bool Remove(Tkeyval obj) { if (TindexesU.ContainsKey(obj)) { Ukeyval val = TindexesU [obj]; TindexesU.Remove(obj); UindexesT.Remove(val); return(true); } return(false); }
/// <summary> /// Remove the specified object. /// </summary> /// <returns><c>true</c>, if the object was in the dictionary and could be removed, <c>false</c> otherwise.</returns> /// <param name="obj">Object.</param> public bool Remove(Ukeyval obj) { if (UindexesT.ContainsKey(obj)) { Tkeyval val = UindexesT [obj]; UindexesT.Remove(obj); TindexesU.Remove(val); return(true); } return(false); }
// METHODS: /// <summary> /// Clears this instance. /// </summary> public void Clear() { TindexesU.Clear(); UindexesT.Clear(); }
// PROPERTIES: public Tkeyval this [ Ukeyval key ] { get { return(UindexesT [key]); } set { UindexesT.Add(key, value); } }
private void Add(Tkeyval Tobj, Ukeyval Uobj) { TindexesU.Add(Tobj, Uobj); UindexesT.Add(Uobj, Tobj); }
/// <summary> /// Tries to get the value corresponding to the key. /// </summary> /// <returns><c>true</c>, if get key existed in the dictionary, <c>false</c> otherwise.</returns> /// <param name="key">Key.</param> /// <param name="value">Value.</param> public bool TryGetValue(Ukeyval key, out Tkeyval value) { return(UindexesT.TryGetValue(key, out value)); }
/// <summary> /// Contains the specified object. /// </summary> /// <returns><c>true</c>, if the dictionary contains the object, <c>false</c> otherwise.</returns> /// <param name="obj">Object.</param> public bool Contains(Ukeyval obj) { return(UindexesT.ContainsKey(obj) || TindexesU.ContainsValue(obj)); }