コード例 #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
 public Dictionary <Tkeyval,  Ukeyval> .Enumerator GetEnumerator()
 {
     return(TindexesU.GetEnumerator());
 }
コード例 #4
0
 public override string ToString()
 {
     return(TindexesU.ToString());
 }
コード例 #5
0
    // METHODS:

    /// <summary>
    /// Clears this instance.
    /// </summary>
    public void Clear()
    {
        TindexesU.Clear();
        UindexesT.Clear();
    }
コード例 #6
0
 public Ukeyval this [
     Tkeyval key
 ] {
     get { return(TindexesU [key]); }
     set { TindexesU.Add(key, value); }
 }
コード例 #7
0
 private void Add(Tkeyval Tobj, Ukeyval Uobj)
 {
     TindexesU.Add(Tobj, Uobj);
     UindexesT.Add(Uobj, Tobj);
 }
コード例 #8
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(Tkeyval key, out Ukeyval value)
 {
     return(TindexesU.TryGetValue(key, out value));
 }
コード例 #9
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));
 }