Files
Dec2017-Script-Dump/System/Collections/Specialized/StringDictionary.cs
T
2026-06-04 11:42:34 +02:00

193 lines
8.9 KiB
C#

using System;
using System.Globalization;
namespace System.Collections.Specialized
{
/// <summary>Implements a hash table with the key and the value strongly typed to be strings rather than objects.</summary>
// Token: 0x0200003A RID: 58
[Serializable]
public class StringDictionary : IEnumerable
{
/// <summary>Initializes a new instance of the <see cref="T:System.Collections.Specialized.StringDictionary" /> class.</summary>
// Token: 0x06000281 RID: 641 RVA: 0x000090F8 File Offset: 0x000072F8
public StringDictionary()
{
this.contents = new Hashtable();
}
/// <summary>Gets the number of key/value pairs in the <see cref="T:System.Collections.Specialized.StringDictionary" />.</summary>
/// <returns>The number of key/value pairs in the <see cref="T:System.Collections.Specialized.StringDictionary" />.Retrieving the value of this property is an O(1) operation.</returns>
// Token: 0x170000B2 RID: 178
// (get) Token: 0x06000282 RID: 642 RVA: 0x0000910C File Offset: 0x0000730C
public virtual int Count
{
get
{
return this.contents.Count;
}
}
/// <summary>Gets a value indicating whether access to the <see cref="T:System.Collections.Specialized.StringDictionary" /> is synchronized (thread safe).</summary>
/// <returns>true if access to the <see cref="T:System.Collections.Specialized.StringDictionary" /> is synchronized (thread safe); otherwise, false.</returns>
// Token: 0x170000B3 RID: 179
// (get) Token: 0x06000283 RID: 643 RVA: 0x0000911C File Offset: 0x0000731C
public virtual bool IsSynchronized
{
get
{
return false;
}
}
/// <summary>Gets or sets the value associated with the specified key.</summary>
/// <returns>The value associated with the specified key. If the specified key is not found, Get returns null, and Set creates a new entry with the specified key.</returns>
/// <param name="key">The key whose value to get or set. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="key" /> is null.</exception>
// Token: 0x170000B4 RID: 180
public virtual string this[string key]
{
get
{
if (key == null)
{
throw new ArgumentNullException("key");
}
return (string)this.contents[key.ToLower(CultureInfo.InvariantCulture)];
}
set
{
if (key == null)
{
throw new ArgumentNullException("key");
}
this.contents[key.ToLower(CultureInfo.InvariantCulture)] = value;
}
}
/// <summary>Gets a collection of keys in the <see cref="T:System.Collections.Specialized.StringDictionary" />.</summary>
/// <returns>An <see cref="T:System.Collections.ICollection" /> that provides the keys in the <see cref="T:System.Collections.Specialized.StringDictionary" />.</returns>
// Token: 0x170000B5 RID: 181
// (get) Token: 0x06000286 RID: 646 RVA: 0x00009194 File Offset: 0x00007394
public virtual ICollection Keys
{
get
{
return this.contents.Keys;
}
}
/// <summary>Gets a collection of values in the <see cref="T:System.Collections.Specialized.StringDictionary" />.</summary>
/// <returns>An <see cref="T:System.Collections.ICollection" /> that provides the values in the <see cref="T:System.Collections.Specialized.StringDictionary" />.</returns>
// Token: 0x170000B6 RID: 182
// (get) Token: 0x06000287 RID: 647 RVA: 0x000091A4 File Offset: 0x000073A4
public virtual ICollection Values
{
get
{
return this.contents.Values;
}
}
/// <summary>Gets an object that can be used to synchronize access to the <see cref="T:System.Collections.Specialized.StringDictionary" />.</summary>
/// <returns>An <see cref="T:System.Object" /> that can be used to synchronize access to the <see cref="T:System.Collections.Specialized.StringDictionary" />.</returns>
// Token: 0x170000B7 RID: 183
// (get) Token: 0x06000288 RID: 648 RVA: 0x000091B4 File Offset: 0x000073B4
public virtual object SyncRoot
{
get
{
return this.contents.SyncRoot;
}
}
/// <summary>Adds an entry with the specified key and value into the <see cref="T:System.Collections.Specialized.StringDictionary" />.</summary>
/// <param name="key">The key of the entry to add. </param>
/// <param name="value">The value of the entry to add. The value can be null. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="key" /> is null. </exception>
/// <exception cref="T:System.ArgumentException">An entry with the same key already exists in the <see cref="T:System.Collections.Specialized.StringDictionary" />. </exception>
/// <exception cref="T:System.NotSupportedException">The <see cref="T:System.Collections.Specialized.StringDictionary" /> is read-only. </exception>
// Token: 0x06000289 RID: 649 RVA: 0x000091C4 File Offset: 0x000073C4
public virtual void Add(string key, string value)
{
if (key == null)
{
throw new ArgumentNullException("key");
}
this.contents.Add(key.ToLower(CultureInfo.InvariantCulture), value);
}
/// <summary>Removes all entries from the <see cref="T:System.Collections.Specialized.StringDictionary" />.</summary>
/// <exception cref="T:System.NotSupportedException">The <see cref="T:System.Collections.Specialized.StringDictionary" /> is read-only. </exception>
// Token: 0x0600028A RID: 650 RVA: 0x000091FC File Offset: 0x000073FC
public virtual void Clear()
{
this.contents.Clear();
}
/// <summary>Determines if the <see cref="T:System.Collections.Specialized.StringDictionary" /> contains a specific key.</summary>
/// <returns>true if the <see cref="T:System.Collections.Specialized.StringDictionary" /> contains an entry with the specified key; otherwise, false.</returns>
/// <param name="key">The key to locate in the <see cref="T:System.Collections.Specialized.StringDictionary" />. </param>
/// <exception cref="T:System.ArgumentNullException">The key is null. </exception>
// Token: 0x0600028B RID: 651 RVA: 0x0000920C File Offset: 0x0000740C
public virtual bool ContainsKey(string key)
{
if (key == null)
{
throw new ArgumentNullException("key");
}
return this.contents.ContainsKey(key.ToLower(CultureInfo.InvariantCulture));
}
/// <summary>Determines if the <see cref="T:System.Collections.Specialized.StringDictionary" /> contains a specific value.</summary>
/// <returns>true if the <see cref="T:System.Collections.Specialized.StringDictionary" /> contains an element with the specified value; otherwise, false.</returns>
/// <param name="value">The value to locate in the <see cref="T:System.Collections.Specialized.StringDictionary" />. The value can be null. </param>
// Token: 0x0600028C RID: 652 RVA: 0x00009238 File Offset: 0x00007438
public virtual bool ContainsValue(string value)
{
return this.contents.ContainsValue(value);
}
/// <summary>Copies the string dictionary values to a one-dimensional <see cref="T:System.Array" /> instance at the specified index.</summary>
/// <param name="array">The one-dimensional <see cref="T:System.Array" /> that is the destination of the values copied from the <see cref="T:System.Collections.Specialized.StringDictionary" />. </param>
/// <param name="index">The index in the array where copying begins. </param>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="array" /> is multidimensional.-or- The number of elements in the <see cref="T:System.Collections.Specialized.StringDictionary" /> is greater than the available space from <paramref name="index" /> to the end of <paramref name="array" />. </exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="array" /> is null. </exception>
/// <exception cref="T:System.ArgumentOutOfRangeException">
/// <paramref name="index" /> is less than the lower bound of <paramref name="array" />. </exception>
// Token: 0x0600028D RID: 653 RVA: 0x00009248 File Offset: 0x00007448
public virtual void CopyTo(Array array, int index)
{
this.contents.CopyTo(array, index);
}
/// <summary>Returns an enumerator that iterates through the string dictionary.</summary>
/// <returns>An <see cref="T:System.Collections.IEnumerator" /> that iterates through the string dictionary.</returns>
// Token: 0x0600028E RID: 654 RVA: 0x00009258 File Offset: 0x00007458
public virtual IEnumerator GetEnumerator()
{
return this.contents.GetEnumerator();
}
/// <summary>Removes the entry with the specified key from the string dictionary.</summary>
/// <param name="key">The key of the entry to remove. </param>
/// <exception cref="T:System.ArgumentNullException">The key is null. </exception>
/// <exception cref="T:System.NotSupportedException">The <see cref="T:System.Collections.Specialized.StringDictionary" /> is read-only. </exception>
// Token: 0x0600028F RID: 655 RVA: 0x00009268 File Offset: 0x00007468
public virtual void Remove(string key)
{
if (key == null)
{
throw new ArgumentNullException("key");
}
this.contents.Remove(key.ToLower(CultureInfo.InvariantCulture));
}
// Token: 0x040000B3 RID: 179
private Hashtable contents;
}
}