using System;
using System.ComponentModel;

namespace Netlm.DataGridGost
{
	/// <summary>
	/// KeyValuePair 的摘要说明。
	/// </summary>
	//[TypeConverter(typeof(KeyValuePairConverter))]
	[DesignTimeVisible(false), ToolboxItem(false)] 
	public class KeyValuePair : System.ComponentModel.Component
	{  
		private System.ComponentModel.Container components = null;
		//键值改变事件,用于防值输入相同的键值
		public event KeyValuePairKeyChanged KeyChanged;
		public void OnKeyChanged()
		{
			if(KeyChanged!=null)
				KeyChanged(_Key);
		}
		private string _Key;

		public string Key
		{
			get { return _Key; }
			set {
				_Key = value;
				OnKeyChanged();
			}
		}

		private string _Value;

		public string Value
		{
			get { return _Value; }
			set { _Value = value; }
		}

		public KeyValuePair(string key, string val)
		{
			//
			// TODO: 在此处添加构造函数逻辑
			//
			_Key = key;
			_Value = val;
		}
		public	KeyValuePair()
		{
			InitializeComponent();
		}
		public KeyValuePair(System.ComponentModel.IContainer container)
		{
			container.Add(this);
			InitializeComponent();
		}
		private void InitializeComponent()
		{
			components = new System.ComponentModel.Container();
		}
	}
}