9 [DesignerSerializer(
"System.Diagnostics.Design.StringDictionaryCodeDomSerializer, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a",
"System.ComponentModel.Design.Serialization.CodeDomSerializer, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
14 internal enum KeyOrValue
24 private KeyOrValue _keyOrValue;
28 public bool IsReadOnly =>
true;
30 public ICollectionToGenericCollectionAdapter(
StringDictionary source, KeyOrValue keyOrValue)
37 _keyOrValue = keyOrValue;
40 public void Add(
string item)
42 ThrowNotSupportedException();
47 ThrowNotSupportedException();
50 public void ThrowNotSupportedException()
52 if (_keyOrValue == KeyOrValue.Key)
59 public bool Contains(
string item)
61 if (_keyOrValue == KeyOrValue.Key)
68 public void CopyTo(
string[] array,
int arrayIndex)
70 ICollection underlyingCollection = GetUnderlyingCollection();
71 underlyingCollection.
CopyTo(array, arrayIndex);
74 public bool Remove(
string item)
76 ThrowNotSupportedException();
82 if (_keyOrValue == KeyOrValue.Key)
84 return _internal.
Keys;
91 ICollection underlyingCollection = GetUnderlyingCollection();
92 foreach (
string item
in underlyingCollection)
100 return GetUnderlyingCollection().GetEnumerator();
106 private ICollectionToGenericCollectionAdapter _values;
108 private ICollectionToGenericCollectionAdapter _keys;
112 public string this[
string key]
124 return m_stringDictionary[key];
132 m_stringDictionary[key] = value;
142 _keys =
new ICollectionToGenericCollectionAdapter(m_stringDictionary, KeyOrValue.Key);
154 _values =
new ICollectionToGenericCollectionAdapter(m_stringDictionary, KeyOrValue.Value);
170 m_stringDictionary = stringDictionary;
173 public void Add(
string key,
string value)
185 m_stringDictionary.
Clear();
188 public bool Remove(
string key)
194 m_stringDictionary.
Remove(key);
198 public bool TryGetValue(
string key, out
string value)
205 value = m_stringDictionary[key];
211 m_stringDictionary.
Add(item.Key, item.Value);
216 if (TryGetValue(item.Key, out
string value))
218 return value.Equals(item.Value);
233 if (array.Length - arrayIndex <
Count)
237 int num = arrayIndex;
250 m_stringDictionary.
Remove(item.Key);
284 public virtual string this[
string key]
323 public virtual void Add(
string key,
string value)
373 contents.
CopyTo(array, index);
380 return contents.GetEnumerator();
396 internal void ReplaceHashtable(
Hashtable useThisHashtableInstead)
398 contents = useThisHashtableInstead;
403 return new GenericAdapter(
this);
static CultureInfo InvariantCulture
Gets the T:System.Globalization.CultureInfo object that is culture-independent (invariant).
virtual bool IsSynchronized
Gets a value indicating whether access to the T:System.Collections.Hashtable is synchronized (thread ...
virtual ICollection Values
Gets a collection of values in the T:System.Collections.Specialized.StringDictionary.
The exception that is thrown when a null reference (Nothing in Visual Basic) is passed to a method th...
virtual void Add(object key, object value)
Adds an element with the specified key and value into the T:System.Collections.Hashtable.
virtual void Add(string key, string value)
Adds an entry with the specified key and value into the T:System.Collections.Specialized....
virtual object SyncRoot
Gets an object that can be used to synchronize access to the T:System.Collections....
virtual ICollection Keys
Gets a collection of keys in the T:System.Collections.Specialized.StringDictionary.
virtual void Remove(string key)
Removes the entry with the specified key from the string dictionary.
Implements a hash table with the key and the value strongly typed to be strings rather than objects.
virtual IEnumerator GetEnumerator()
Returns an enumerator that iterates through the string dictionary.
The exception that is thrown when the value of an argument is outside the allowable range of values a...
virtual bool IsSynchronized
Gets a value indicating whether access to the T:System.Collections.Specialized.StringDictionary is sy...
virtual bool ContainsKey(object key)
Determines whether the T:System.Collections.Hashtable contains a specific key.
The exception that is thrown when the key specified for accessing an element in a collection does not...
virtual ICollection Values
Gets an T:System.Collections.ICollection containing the values in the T:System.Collections....
Defines a key/value pair that can be set or retrieved.
Exposes an enumerator, which supports a simple iteration over a non-generic collection....
virtual void CopyTo(Array array, int arrayIndex)
Copies the T:System.Collections.Hashtable elements to a one-dimensional T:System.Array instance at th...
Represents a collection of key/value pairs that are organized based on the hash code of the key....
virtual ICollection Keys
Gets an T:System.Collections.ICollection containing the keys in the T:System.Collections....
Provides methods for creating, manipulating, searching, and sorting arrays, thereby serving as the ba...
virtual int Count
Gets the number of key/value pairs in the T:System.Collections.Specialized.StringDictionary.
virtual bool ContainsValue(string value)
Determines if the T:System.Collections.Specialized.StringDictionary contains a specific value.
virtual void CopyTo(Array array, int index)
Copies the string dictionary values to a one-dimensional T:System.Array instance at the specified ind...
IEnumerator GetEnumerator()
Returns an enumerator that iterates through a collection.
virtual bool ContainsValue(object value)
Determines whether the T:System.Collections.Hashtable contains a specific value.
virtual object SyncRoot
Gets an object that can be used to synchronize access to the T:System.Collections....
virtual void Clear()
Removes all entries from the T:System.Collections.Specialized.StringDictionary.
The exception that is thrown when one of the arguments provided to a method is not valid.
virtual bool ContainsKey(string key)
Determines if the T:System.Collections.Specialized.StringDictionary contains a specific key.
virtual void Remove(object key)
Removes the element with the specified key from the T:System.Collections.Hashtable.
Specifies that the class can be serialized.
virtual void Clear()
Removes all elements from the T:System.Collections.Hashtable.
Provides information about a specific culture (called a locale for unmanaged code development)....
The exception that is thrown when an invoked method is not supported, or when there is an attempt to ...
Defines size, enumerators, and synchronization methods for all nongeneric collections.
void CopyTo(Array array, int index)
Copies the elements of the T:System.Collections.ICollection to an T:System.Array, starting at a parti...
Defines a dictionary key/value pair that can be set or retrieved.
Represents a nongeneric collection of key/value pairs.
virtual int Count
Gets the number of key/value pairs contained in the T:System.Collections.Hashtable.