using System; using System.Collections; namespace System.Runtime.Remoting.Messaging { // Token: 0x020003F8 RID: 1016 [Serializable] internal class MethodDictionary : IEnumerable, ICollection, IDictionary { // Token: 0x06002781 RID: 10113 RVA: 0x00081884 File Offset: 0x0007FA84 public MethodDictionary(IMethodMessage message) { this._message = message; } // Token: 0x06002782 RID: 10114 RVA: 0x00081894 File Offset: 0x0007FA94 public MethodDictionary(string[] keys) { this._methodKeys = keys; } // Token: 0x06002783 RID: 10115 RVA: 0x000818A4 File Offset: 0x0007FAA4 IEnumerator IEnumerable.GetEnumerator() { return new MethodDictionary.DictionaryEnumerator(this); } // Token: 0x17000792 RID: 1938 // (get) Token: 0x06002784 RID: 10116 RVA: 0x000818AC File Offset: 0x0007FAAC internal bool HasInternalProperties { get { if (this._internalProperties == null) { return false; } if (this._internalProperties is MethodDictionary) { return ((MethodDictionary)this._internalProperties).HasInternalProperties; } return this._internalProperties.Count > 0; } } // Token: 0x17000793 RID: 1939 // (get) Token: 0x06002785 RID: 10117 RVA: 0x000818F8 File Offset: 0x0007FAF8 internal IDictionary InternalProperties { get { if (this._internalProperties != null && this._internalProperties is MethodDictionary) { return ((MethodDictionary)this._internalProperties).InternalProperties; } return this._internalProperties; } } // Token: 0x17000794 RID: 1940 // (get) Token: 0x06002786 RID: 10118 RVA: 0x00081938 File Offset: 0x0007FB38 // (set) Token: 0x06002787 RID: 10119 RVA: 0x00081940 File Offset: 0x0007FB40 public string[] MethodKeys { get { return this._methodKeys; } set { this._methodKeys = value; } } // Token: 0x06002788 RID: 10120 RVA: 0x0008194C File Offset: 0x0007FB4C protected virtual IDictionary AllocInternalProperties() { this._ownProperties = true; return new Hashtable(); } // Token: 0x06002789 RID: 10121 RVA: 0x0008195C File Offset: 0x0007FB5C public IDictionary GetInternalProperties() { if (this._internalProperties == null) { this._internalProperties = this.AllocInternalProperties(); } return this._internalProperties; } // Token: 0x0600278A RID: 10122 RVA: 0x0008197C File Offset: 0x0007FB7C private bool IsOverridenKey(string key) { if (this._ownProperties) { return false; } foreach (string text in this._methodKeys) { if (key == text) { return true; } } return false; } // Token: 0x17000795 RID: 1941 // (get) Token: 0x0600278B RID: 10123 RVA: 0x000819C4 File Offset: 0x0007FBC4 public bool IsFixedSize { get { return false; } } // Token: 0x17000796 RID: 1942 // (get) Token: 0x0600278C RID: 10124 RVA: 0x000819C8 File Offset: 0x0007FBC8 public bool IsReadOnly { get { return false; } } // Token: 0x17000797 RID: 1943 public object this[object key] { get { string text = (string)key; for (int i = 0; i < this._methodKeys.Length; i++) { if (this._methodKeys[i] == text) { return this.GetMethodProperty(text); } } if (this._internalProperties != null) { return this._internalProperties[key]; } return null; } set { this.Add(key, value); } } // Token: 0x0600278F RID: 10127 RVA: 0x00081A3C File Offset: 0x0007FC3C protected virtual object GetMethodProperty(string key) { switch (key) { case "__Uri": return this._message.Uri; case "__MethodName": return this._message.MethodName; case "__TypeName": return this._message.TypeName; case "__MethodSignature": return this._message.MethodSignature; case "__CallContext": return this._message.LogicalCallContext; case "__Args": return this._message.Args; case "__OutArgs": return ((IMethodReturnMessage)this._message).OutArgs; case "__Return": return ((IMethodReturnMessage)this._message).ReturnValue; } return null; } // Token: 0x06002790 RID: 10128 RVA: 0x00081B70 File Offset: 0x0007FD70 protected virtual void SetMethodProperty(string key, object value) { switch (key) { case "__CallContext": case "__OutArgs": case "__Return": return; case "__MethodName": case "__TypeName": case "__MethodSignature": case "__Args": throw new ArgumentException("key was invalid"); case "__Uri": ((IInternalMessage)this._message).Uri = (string)value; return; } } // Token: 0x17000798 RID: 1944 // (get) Token: 0x06002791 RID: 10129 RVA: 0x00081C48 File Offset: 0x0007FE48 public ICollection Keys { get { ArrayList arrayList = new ArrayList(); for (int i = 0; i < this._methodKeys.Length; i++) { arrayList.Add(this._methodKeys[i]); } if (this._internalProperties != null) { foreach (object obj in this._internalProperties.Keys) { string text = (string)obj; if (!this.IsOverridenKey(text)) { arrayList.Add(text); } } } return arrayList; } } // Token: 0x17000799 RID: 1945 // (get) Token: 0x06002792 RID: 10130 RVA: 0x00081D08 File Offset: 0x0007FF08 public ICollection Values { get { ArrayList arrayList = new ArrayList(); for (int i = 0; i < this._methodKeys.Length; i++) { arrayList.Add(this.GetMethodProperty(this._methodKeys[i])); } if (this._internalProperties != null) { foreach (object obj in this._internalProperties) { DictionaryEntry dictionaryEntry = (DictionaryEntry)obj; if (!this.IsOverridenKey((string)dictionaryEntry.Key)) { arrayList.Add(dictionaryEntry.Value); } } } return arrayList; } } // Token: 0x06002793 RID: 10131 RVA: 0x00081DD8 File Offset: 0x0007FFD8 public void Add(object key, object value) { string text = (string)key; for (int i = 0; i < this._methodKeys.Length; i++) { if (this._methodKeys[i] == text) { this.SetMethodProperty(text, value); return; } } if (this._internalProperties == null) { this._internalProperties = this.AllocInternalProperties(); } this._internalProperties[key] = value; } // Token: 0x06002794 RID: 10132 RVA: 0x00081E48 File Offset: 0x00080048 public void Clear() { if (this._internalProperties != null) { this._internalProperties.Clear(); } } // Token: 0x06002795 RID: 10133 RVA: 0x00081E60 File Offset: 0x00080060 public bool Contains(object key) { string text = (string)key; for (int i = 0; i < this._methodKeys.Length; i++) { if (this._methodKeys[i] == text) { return true; } } return this._internalProperties != null && this._internalProperties.Contains(key); } // Token: 0x06002796 RID: 10134 RVA: 0x00081EBC File Offset: 0x000800BC public void Remove(object key) { string text = (string)key; for (int i = 0; i < this._methodKeys.Length; i++) { if (this._methodKeys[i] == text) { throw new ArgumentException("key was invalid"); } } if (this._internalProperties != null) { this._internalProperties.Remove(key); } } // Token: 0x1700079A RID: 1946 // (get) Token: 0x06002797 RID: 10135 RVA: 0x00081F20 File Offset: 0x00080120 public int Count { get { if (this._internalProperties != null) { return this._internalProperties.Count + this._methodKeys.Length; } return this._methodKeys.Length; } } // Token: 0x1700079B RID: 1947 // (get) Token: 0x06002798 RID: 10136 RVA: 0x00081F58 File Offset: 0x00080158 public bool IsSynchronized { get { return false; } } // Token: 0x1700079C RID: 1948 // (get) Token: 0x06002799 RID: 10137 RVA: 0x00081F5C File Offset: 0x0008015C public object SyncRoot { get { return this; } } // Token: 0x0600279A RID: 10138 RVA: 0x00081F60 File Offset: 0x00080160 public void CopyTo(Array array, int index) { this.Values.CopyTo(array, index); } // Token: 0x0600279B RID: 10139 RVA: 0x00081F70 File Offset: 0x00080170 public IDictionaryEnumerator GetEnumerator() { return new MethodDictionary.DictionaryEnumerator(this); } // Token: 0x04000F59 RID: 3929 private IDictionary _internalProperties; // Token: 0x04000F5A RID: 3930 protected IMethodMessage _message; // Token: 0x04000F5B RID: 3931 private string[] _methodKeys; // Token: 0x04000F5C RID: 3932 private bool _ownProperties; // Token: 0x020003F9 RID: 1017 private class DictionaryEnumerator : IEnumerator, IDictionaryEnumerator { // Token: 0x0600279C RID: 10140 RVA: 0x00081F78 File Offset: 0x00080178 public DictionaryEnumerator(MethodDictionary methodDictionary) { this._methodDictionary = methodDictionary; IDictionaryEnumerator dictionaryEnumerator; if (this._methodDictionary._internalProperties != null) { IDictionaryEnumerator enumerator = this._methodDictionary._internalProperties.GetEnumerator(); dictionaryEnumerator = enumerator; } else { dictionaryEnumerator = null; } this._hashtableEnum = dictionaryEnumerator; this._posMethod = -1; } // Token: 0x1700079D RID: 1949 // (get) Token: 0x0600279D RID: 10141 RVA: 0x00081FC8 File Offset: 0x000801C8 public object Current { get { return this.Entry.Value; } } // Token: 0x0600279E RID: 10142 RVA: 0x00081FE4 File Offset: 0x000801E4 public bool MoveNext() { if (this._posMethod != -2) { this._posMethod++; if (this._posMethod < this._methodDictionary._methodKeys.Length) { return true; } this._posMethod = -2; } if (this._hashtableEnum == null) { return false; } while (this._hashtableEnum.MoveNext()) { if (!this._methodDictionary.IsOverridenKey((string)this._hashtableEnum.Key)) { return true; } } return false; } // Token: 0x0600279F RID: 10143 RVA: 0x00082074 File Offset: 0x00080274 public void Reset() { this._posMethod = -1; this._hashtableEnum.Reset(); } // Token: 0x1700079E RID: 1950 // (get) Token: 0x060027A0 RID: 10144 RVA: 0x00082088 File Offset: 0x00080288 public DictionaryEntry Entry { get { if (this._posMethod >= 0) { return new DictionaryEntry(this._methodDictionary._methodKeys[this._posMethod], this._methodDictionary.GetMethodProperty(this._methodDictionary._methodKeys[this._posMethod])); } if (this._posMethod == -1 || this._hashtableEnum == null) { throw new InvalidOperationException("The enumerator is positioned before the first element of the collection or after the last element"); } return this._hashtableEnum.Entry; } } // Token: 0x1700079F RID: 1951 // (get) Token: 0x060027A1 RID: 10145 RVA: 0x00082104 File Offset: 0x00080304 public object Key { get { return this.Entry.Key; } } // Token: 0x170007A0 RID: 1952 // (get) Token: 0x060027A2 RID: 10146 RVA: 0x00082120 File Offset: 0x00080320 public object Value { get { return this.Entry.Value; } } // Token: 0x04000F5F RID: 3935 private MethodDictionary _methodDictionary; // Token: 0x04000F60 RID: 3936 private IDictionaryEnumerator _hashtableEnum; // Token: 0x04000F61 RID: 3937 private int _posMethod; } } }