Пример #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);
 }
Пример #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);
 }
Пример #3
0
    // METHODS:

    /// <summary>
    /// Clears this instance.
    /// </summary>
    public void Clear()
    {
        TindexesU.Clear();
        UindexesT.Clear();
    }
Пример #4
0
    // PROPERTIES:

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