Beispiel #1
0
 /// <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);
 }
Beispiel #2
0
 /// <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);
 }
Beispiel #3
0
    // METHODS:

    /// <summary>
    /// Clears this instance.
    /// </summary>
    public void Clear()
    {
        TindexesU.Clear();
        UindexesT.Clear();
    }
Beispiel #4
0
    // PROPERTIES:

    public Tkeyval this [
        Ukeyval key
    ] {
        get { return(UindexesT [key]); }
        set { UindexesT.Add(key, value); }
    }
Beispiel #5
0
 private void Add(Tkeyval Tobj, Ukeyval Uobj)
 {
     TindexesU.Add(Tobj, Uobj);
     UindexesT.Add(Uobj, Tobj);
 }
Beispiel #6
0
 /// <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));
 }
Beispiel #7
0
 /// <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));
 }