using System;
using System.Runtime.InteropServices;
namespace System.Collections
{
/// Provides the abstract base class for a strongly typed collection of key/value pairs.
/// 2
// Token: 0x02000128 RID: 296
[ComVisible(true)]
[Serializable]
public abstract class DictionaryBase : IEnumerable, ICollection, IDictionary
{
/// Initializes a new instance of the class.
// Token: 0x06000F56 RID: 3926 RVA: 0x00040698 File Offset: 0x0003E898
protected DictionaryBase()
{
this.hashtable = new Hashtable();
}
/// Gets a value indicating whether a object has a fixed size.
/// true if the object has a fixed size; otherwise, false. The default is false.
// Token: 0x17000264 RID: 612
// (get) Token: 0x06000F57 RID: 3927 RVA: 0x000406AC File Offset: 0x0003E8AC
bool IDictionary.IsFixedSize
{
get
{
return false;
}
}
/// Gets a value indicating whether a object is read-only.
/// true if the object is read-only; otherwise, false. The default is false.
// Token: 0x17000265 RID: 613
// (get) Token: 0x06000F58 RID: 3928 RVA: 0x000406B0 File Offset: 0x0003E8B0
bool IDictionary.IsReadOnly
{
get
{
return false;
}
}
/// Gets or sets the value associated with the specified key.
/// The value associated with the specified key. If the specified key is not found, attempting to get it returns null, and attempting to set it creates a new element using the specified key.
/// The key whose value to get or set.
///
/// is null.
/// The property is set and the is read-only.-or- The property is set, does not exist in the collection, and the has a fixed size.
// Token: 0x17000266 RID: 614
object IDictionary.this[object key]
{
get
{
object obj = this.hashtable[key];
this.OnGet(key, obj);
return obj;
}
set
{
this.OnValidate(key, value);
object obj = this.hashtable[key];
this.OnSet(key, obj, value);
this.hashtable[key] = value;
try
{
this.OnSetComplete(key, obj, value);
}
catch
{
this.hashtable[key] = obj;
throw;
}
}
}
/// Gets an object containing the keys in the object.
/// An object containing the keys in the object.
// Token: 0x17000267 RID: 615
// (get) Token: 0x06000F5B RID: 3931 RVA: 0x00040750 File Offset: 0x0003E950
ICollection IDictionary.Keys
{
get
{
return this.hashtable.Keys;
}
}
/// Gets an object containing the values in the object.
/// An object containing the values in the object.
// Token: 0x17000268 RID: 616
// (get) Token: 0x06000F5C RID: 3932 RVA: 0x00040760 File Offset: 0x0003E960
ICollection IDictionary.Values
{
get
{
return this.hashtable.Values;
}
}
/// Adds an element with the specified key and value into the .
/// The key of the element to add.
/// The value of the element to add.
///
/// is null.
/// An element with the same key already exists in the .
/// The is read-only.-or- The has a fixed size.
// Token: 0x06000F5D RID: 3933 RVA: 0x00040770 File Offset: 0x0003E970
void IDictionary.Add(object key, object value)
{
this.OnValidate(key, value);
this.OnInsert(key, value);
this.hashtable.Add(key, value);
try
{
this.OnInsertComplete(key, value);
}
catch
{
this.hashtable.Remove(key);
throw;
}
}
/// Removes the element with the specified key from the .
/// The key of the element to remove.
///
/// is null.
/// The is read-only.-or- The has a fixed size.
// Token: 0x06000F5E RID: 3934 RVA: 0x000407D8 File Offset: 0x0003E9D8
void IDictionary.Remove(object key)
{
if (!this.hashtable.Contains(key))
{
return;
}
object obj = this.hashtable[key];
this.OnValidate(key, obj);
this.OnRemove(key, obj);
this.hashtable.Remove(key);
try
{
this.OnRemoveComplete(key, obj);
}
catch
{
this.hashtable[key] = obj;
throw;
}
}
/// Determines whether the contains a specific key.
/// true if the contains an element with the specified key; otherwise, false.
/// The key to locate in the .
///
/// is null.
// Token: 0x06000F5F RID: 3935 RVA: 0x00040860 File Offset: 0x0003EA60
bool IDictionary.Contains(object key)
{
return this.hashtable.Contains(key);
}
/// Gets a value indicating whether access to a object is synchronized (thread safe).
/// true if access to the object is synchronized (thread safe); otherwise, false. The default is false.
// Token: 0x17000269 RID: 617
// (get) Token: 0x06000F60 RID: 3936 RVA: 0x00040870 File Offset: 0x0003EA70
bool ICollection.IsSynchronized
{
get
{
return this.hashtable.IsSynchronized;
}
}
/// Gets an object that can be used to synchronize access to a object.
/// An object that can be used to synchronize access to the object.
// Token: 0x1700026A RID: 618
// (get) Token: 0x06000F61 RID: 3937 RVA: 0x00040880 File Offset: 0x0003EA80
object ICollection.SyncRoot
{
get
{
return this.hashtable.SyncRoot;
}
}
/// Returns an that iterates through the .
/// An for the .
// Token: 0x06000F62 RID: 3938 RVA: 0x00040890 File Offset: 0x0003EA90
IEnumerator IEnumerable.GetEnumerator()
{
return this.hashtable.GetEnumerator();
}
/// Clears the contents of the instance.
/// 2
// Token: 0x06000F63 RID: 3939 RVA: 0x000408A0 File Offset: 0x0003EAA0
public void Clear()
{
this.OnClear();
this.hashtable.Clear();
this.OnClearComplete();
}
/// Gets the number of elements contained in the instance.
/// The number of elements contained in the instance.
/// 2
// Token: 0x1700026B RID: 619
// (get) Token: 0x06000F64 RID: 3940 RVA: 0x000408C4 File Offset: 0x0003EAC4
public int Count
{
get
{
return this.hashtable.Count;
}
}
/// Gets the list of elements contained in the instance.
/// An representing the instance itself.
// Token: 0x1700026C RID: 620
// (get) Token: 0x06000F65 RID: 3941 RVA: 0x000408D4 File Offset: 0x0003EAD4
protected IDictionary Dictionary
{
get
{
return this;
}
}
/// Gets the list of elements contained in the instance.
/// A representing the instance itself.
// Token: 0x1700026D RID: 621
// (get) Token: 0x06000F66 RID: 3942 RVA: 0x000408D8 File Offset: 0x0003EAD8
protected Hashtable InnerHashtable
{
get
{
return this.hashtable;
}
}
/// Copies the elements to a one-dimensional at the specified index.
/// The one-dimensional that is the destination of the objects copied from the instance. The must have zero-based indexing.
/// The zero-based index in at which copying begins.
///
/// is null.
///
/// is less than zero.
///
/// is multidimensional.-or- The number of elements in the source is greater than the available space from to the end of the destination .
/// The type of the source cannot be cast automatically to the type of the destination .
/// 2
// Token: 0x06000F67 RID: 3943 RVA: 0x000408E0 File Offset: 0x0003EAE0
public void CopyTo(Array array, int index)
{
if (array == null)
{
throw new ArgumentNullException("array");
}
if (index < 0)
{
throw new ArgumentOutOfRangeException("index must be possitive");
}
if (array.Rank > 1)
{
throw new ArgumentException("array is multidimensional");
}
int length = array.Length;
if (index > length)
{
throw new ArgumentException("index is larger than array size");
}
if (index + this.Count > length)
{
throw new ArgumentException("Copy will overlflow array");
}
this.DoCopy(array, index);
}
// Token: 0x06000F68 RID: 3944 RVA: 0x00040964 File Offset: 0x0003EB64
private void DoCopy(Array array, int index)
{
foreach (object obj in this.hashtable)
{
DictionaryEntry dictionaryEntry = (DictionaryEntry)obj;
array.SetValue(dictionaryEntry, index++);
}
}
/// Returns an that iterates through the instance.
/// An for the instance.
/// 2
// Token: 0x06000F69 RID: 3945 RVA: 0x000409E0 File Offset: 0x0003EBE0
public IDictionaryEnumerator GetEnumerator()
{
return this.hashtable.GetEnumerator();
}
/// Performs additional custom processes before clearing the contents of the instance.
// Token: 0x06000F6A RID: 3946 RVA: 0x000409F0 File Offset: 0x0003EBF0
protected virtual void OnClear()
{
}
/// Performs additional custom processes after clearing the contents of the instance.
// Token: 0x06000F6B RID: 3947 RVA: 0x000409F4 File Offset: 0x0003EBF4
protected virtual void OnClearComplete()
{
}
/// Gets the element with the specified key and value in the instance.
/// An containing the element with the specified key and value.
/// The key of the element to get.
/// The current value of the element associated with .
// Token: 0x06000F6C RID: 3948 RVA: 0x000409F8 File Offset: 0x0003EBF8
protected virtual object OnGet(object key, object currentValue)
{
return currentValue;
}
/// Performs additional custom processes before inserting a new element into the instance.
/// The key of the element to insert.
/// The value of the element to insert.
// Token: 0x06000F6D RID: 3949 RVA: 0x000409FC File Offset: 0x0003EBFC
protected virtual void OnInsert(object key, object value)
{
}
/// Performs additional custom processes after inserting a new element into the instance.
/// The key of the element to insert.
/// The value of the element to insert.
// Token: 0x06000F6E RID: 3950 RVA: 0x00040A00 File Offset: 0x0003EC00
protected virtual void OnInsertComplete(object key, object value)
{
}
/// Performs additional custom processes before setting a value in the instance.
/// The key of the element to locate.
/// The old value of the element associated with .
/// The new value of the element associated with .
// Token: 0x06000F6F RID: 3951 RVA: 0x00040A04 File Offset: 0x0003EC04
protected virtual void OnSet(object key, object oldValue, object newValue)
{
}
/// Performs additional custom processes after setting a value in the instance.
/// The key of the element to locate.
/// The old value of the element associated with .
/// The new value of the element associated with .
// Token: 0x06000F70 RID: 3952 RVA: 0x00040A08 File Offset: 0x0003EC08
protected virtual void OnSetComplete(object key, object oldValue, object newValue)
{
}
/// Performs additional custom processes before removing an element from the instance.
/// The key of the element to remove.
/// The value of the element to remove.
// Token: 0x06000F71 RID: 3953 RVA: 0x00040A0C File Offset: 0x0003EC0C
protected virtual void OnRemove(object key, object value)
{
}
/// Performs additional custom processes after removing an element from the instance.
/// The key of the element to remove.
/// The value of the element to remove.
// Token: 0x06000F72 RID: 3954 RVA: 0x00040A10 File Offset: 0x0003EC10
protected virtual void OnRemoveComplete(object key, object value)
{
}
/// Performs additional custom processes when validating the element with the specified key and value.
/// The key of the element to validate.
/// The value of the element to validate.
// Token: 0x06000F73 RID: 3955 RVA: 0x00040A14 File Offset: 0x0003EC14
protected virtual void OnValidate(object key, object value)
{
}
// Token: 0x040003BC RID: 956
private Hashtable hashtable;
}
}