Exemplo n.º 1
0
        /// <summary>
        /// Gets and sets the value with the specified key. Argument Exception is thrown
        /// if the key does not already exist in the hash table.
        /// </summary>
        /// <param name="key">The key value to retrieve</param>
        /// <returns>The value associated with the specified key</returns>
        public TValue this[TKey key]
        {
            get
            {
                TValue value;
                if (!_array.TryGetValue(key, out value))
                {
                    throw new ArgumentException("key");
                }

                return(value);
            }
            set
            {
                _array.Update(key, value);
            }
        }