using System; using System.Collections.Generic; namespace wf { public class ReadOnlySortedDictionary { public ReadOnlySortedDictionary(SortedDictionary srcData) { this.srcData = srcData; } public TVal this[Tkey key] { get { return this.Get(key); } } public int Count { get { return this.srcData.Count; } } public bool ContainsKey(Tkey key) { return this.srcData.ContainsKey(key); } public TVal Get(Tkey key) { return this.srcData[key]; } public Tkey[] GetKeyArray() { Tkey[] array = new Tkey[this.srcData.Count]; int num = 0; foreach (KeyValuePair keyValuePair in this.srcData) { array[num++] = keyValuePair.Key; } return array; } public TVal[] GetValueArray() { TVal[] array = new TVal[this.srcData.Count]; int num = 0; foreach (KeyValuePair keyValuePair in this.srcData) { array[num++] = keyValuePair.Value; } return array; } public SortedDictionary Copy() { return new SortedDictionary(this.srcData); } private SortedDictionary srcData; } }