コード例 #1
0
        /// <inheritdoc />
        public TChunk this[TKey key]
        {
            get
            {
                IReadOnlyDictionaryContracts.Indexer(this, key);

                return(this.stage[key]);
            }
        }
コード例 #2
0
        /// <inheritdoc />
        public bool TryGetValue(TKey key, out TValue value)
        {
            IReadOnlyDictionaryContracts.TryGetValue(key);

            if (this.Dictionary != null)
            {
                return(this.Dictionary.TryGetValue(key, out value));
            }

            foreach (var item in this)
            {
                if (this.Comparer.Equals(key, this.GetKeyForItem(item)))
                {
                    value = item;
                    return(true);
                }
            }

            value = default(TValue);
            return(false);
        }
コード例 #3
0
        /// <inheritdoc />
        public bool ContainsKey(TKey key)
        {
            IReadOnlyDictionaryContracts.ContainsKey(key);

            return(this.Contains(key));
        }
コード例 #4
0
        /// <inheritdoc />
        public bool TryGetValue(TKey key, out TChunk chunk)
        {
            IReadOnlyDictionaryContracts.TryGetValue(key);

            return(this.stage.TryGetValue(key, out chunk));
        }