using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using Minntech.Common;

namespace Minntech.Common.Settings
{
	/// <summary>
	/// Summary description for dlgNewNode.
	/// </summary>
	public class dlgEditNode : System.Windows.Forms.Form
	{
		public System.Windows.Forms.TextBox SettingName;
		public System.Windows.Forms.TextBox SettingValue;
		private System.Windows.Forms.Label label1;
		private System.Windows.Forms.Label label2;
		private System.Windows.Forms.Button commandOK;
		private System.Windows.Forms.Button commandCancel;
		/// <summary>
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.Container components = null;

		public dlgEditNode()
		{
			InitializeComponent();
		}

		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if(components != null)
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Windows Form Designer generated code
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
			this.SettingName = new System.Windows.Forms.TextBox();
			this.SettingValue = new System.Windows.Forms.TextBox();
			this.label1 = new System.Windows.Forms.Label();
			this.label2 = new System.Windows.Forms.Label();
			this.commandOK = new System.Windows.Forms.Button();
			this.commandCancel = new System.Windows.Forms.Button();
			this.SuspendLayout();
			// 
			// SettingName
			// 
			this.SettingName.Location = new System.Drawing.Point(80, 8);
			this.SettingName.Name = "SettingName";
			this.SettingName.Size = new System.Drawing.Size(160, 20);
			this.SettingName.TabIndex = 0;
			this.SettingName.Text = "";
			// 
			// SettingValue
			// 
			this.SettingValue.Location = new System.Drawing.Point(80, 32);
			this.SettingValue.Name = "SettingValue";
			this.SettingValue.Size = new System.Drawing.Size(160, 20);
			this.SettingValue.TabIndex = 1;
			this.SettingValue.Text = "";
			// 
			// label1
			// 
			this.label1.Location = new System.Drawing.Point(8, 8);
			this.label1.Name = "label1";
			this.label1.TabIndex = 2;
			this.label1.Text = "Name";
			// 
			// label2
			// 
			this.label2.Location = new System.Drawing.Point(8, 32);
			this.label2.Name = "label2";
			this.label2.TabIndex = 3;
			this.label2.Text = "Value";
			// 
			// commandOK
			// 
			this.commandOK.DialogResult = System.Windows.Forms.DialogResult.OK;
			this.commandOK.Location = new System.Drawing.Point(248, 8);
			this.commandOK.Name = "commandOK";
			this.commandOK.Size = new System.Drawing.Size(75, 20);
			this.commandOK.TabIndex = 5;
			this.commandOK.Text = "OK";
			this.commandOK.Click += new System.EventHandler(this.commandOK_Click);
			// 
			// commandCancel
			// 
			this.commandCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
			this.commandCancel.Location = new System.Drawing.Point(248, 32);
			this.commandCancel.Name = "commandCancel";
			this.commandCancel.Size = new System.Drawing.Size(75, 20);
			this.commandCancel.TabIndex = 6;
			this.commandCancel.Text = "Cancel";
			this.commandCancel.Click += new System.EventHandler(this.commandCancel_Click);
			// 
			// dlgEditNode
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
			this.ClientSize = new System.Drawing.Size(328, 61);
			this.Controls.Add(this.commandCancel);
			this.Controls.Add(this.commandOK);
			this.Controls.Add(this.SettingValue);
			this.Controls.Add(this.SettingName);
			this.Controls.Add(this.label2);
			this.Controls.Add(this.label1);
			this.Name = "dlgEditNode";
			this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
			this.Text = "Edit Setting";
			this.ResumeLayout(false);

		}
		#endregion

		private void commandOK_Click(object sender, System.EventArgs e)
		{
			if ( ( this.SettingName.Text == null ) || ( this.SettingName.Text == string.Empty ) )
				MsgBox.Show("Setting Name is required!", "Settings Error");
			else
				this.Hide();
		}

		private void commandCancel_Click(object sender, System.EventArgs e)
		{
			this.Hide();
		}
	}
}
