using System;
using System.Collections.Generic;

namespace wf
{
	public class ReadOnlyDictionary<Tkey, TVal>
	{
		public ReadOnlyDictionary(Dictionary<Tkey, TVal> 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<Tkey, TVal> 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<Tkey, TVal> keyValuePair in this.srcData)
			{
				array[num++] = keyValuePair.Value;
			}
			return array;
		}

		public Dictionary<Tkey, TVal> Copy()
		{
			return new Dictionary<Tkey, TVal>(this.srcData);
		}

		private Dictionary<Tkey, TVal> srcData;
	}
}
