コード例 #1
0
        public override bool TryGetValue(string key, out string value)
        {
            uint keyInt = this._stringTable.Add(key);

            using (IEnumerator <StringTableTagsCollection.TagEncoded> enumerator = this._tagsList.Where <StringTableTagsCollection.TagEncoded>((Func <StringTableTagsCollection.TagEncoded, bool>)(tagEncoded => (int)tagEncoded.Key == (int)keyInt)).GetEnumerator())
            {
                if (enumerator.MoveNext())
                {
                    StringTableTagsCollection.TagEncoded current = enumerator.Current;
                    value = this._stringTable.Get(current.Value);
                    return(true);
                }
            }
            value = (string)null;
            return(false);
        }
コード例 #2
0
        public override void AddOrReplace(string key, string value)
        {
            uint num1 = this._stringTable.Add(key);
            uint num2 = this._stringTable.Add(value);

            for (int index = 0; index < this._tagsList.Count; ++index)
            {
                StringTableTagsCollection.TagEncoded tags = this._tagsList[index];
                if ((int)tags.Key == (int)num1)
                {
                    tags.Value            = num2;
                    this._tagsList[index] = tags;
                    return;
                }
            }
            this._tagsList.Add(new StringTableTagsCollection.TagEncoded()
            {
                Key   = num1,
                Value = num2
            });
        }