using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using nft.util;

namespace nft.ui.system
{
	/// <summary>
	/// SystemInfoForm の概要の説明です。
	/// </summary>
	public class SystemInfoForm : System.Windows.Forms.Form
	{
		private System.Windows.Forms.Button btnOK;
		private System.Windows.Forms.Button btnCopy;
		private System.Windows.Forms.TextBox sysInfoText;
		/// <summary>
		/// 必要なデザイナ変数です。
		/// </summary>
		private System.ComponentModel.Container components = null;

		public SystemInfoForm()
		{
			//
			// Windows フォーム デザイナ サポートに必要です。
			//
			InitializeComponent();

			//
			// TODO: InitializeComponent 呼び出しの後に、コンストラクタ コードを追加してください。
			//
		}

		/// <summary>
		/// 使用されているリソースに後処理を実行します。
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if(components != null)
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Windows フォーム デザイナで生成されたコード 
		/// <summary>
		/// デザイナ サポートに必要なメソッドです。このメソッドの内容を
		/// コード エディタで変更しないでください。
		/// </summary>
		private void InitializeComponent()
		{
			System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(SystemInfoForm));
			this.sysInfoText = new System.Windows.Forms.TextBox();
			this.btnOK = new System.Windows.Forms.Button();
			this.btnCopy = new System.Windows.Forms.Button();
			this.SuspendLayout();
			// 
			// sysInfoText
			// 
			this.sysInfoText.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
				| System.Windows.Forms.AnchorStyles.Left) 
				| System.Windows.Forms.AnchorStyles.Right)));
			this.sysInfoText.Location = new System.Drawing.Point(0, 0);
			this.sysInfoText.Multiline = true;
			this.sysInfoText.Name = "sysInfoText";
			this.sysInfoText.ReadOnly = true;
			this.sysInfoText.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
			this.sysInfoText.Size = new System.Drawing.Size(496, 120);
			this.sysInfoText.TabIndex = 0;
			this.sysInfoText.Text = "";
			// 
			// btnOK
			// 
			this.btnOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
			this.btnOK.Location = new System.Drawing.Point(392, 128);
			this.btnOK.Name = "btnOK";
			this.btnOK.Size = new System.Drawing.Size(88, 24);
			this.btnOK.TabIndex = 1;
			this.btnOK.Text = "&OK";
			this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
			// 
			// btnCopy
			// 
			this.btnCopy.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
			this.btnCopy.Location = new System.Drawing.Point(16, 128);
			this.btnCopy.Name = "btnCopy";
			this.btnCopy.Size = new System.Drawing.Size(160, 24);
			this.btnCopy.TabIndex = 1;
			this.btnCopy.Text = "クリップボードにコピー(&C)";
			this.btnCopy.Click += new System.EventHandler(this.btnCopy_Click);
			// 
			// SystemInfoForm
			// 
			this.AcceptButton = this.btnOK;
			this.AutoScaleBaseSize = new System.Drawing.Size(5, 12);
			this.ClientSize = new System.Drawing.Size(496, 157);
			this.Controls.Add(this.btnOK);
			this.Controls.Add(this.sysInfoText);
			this.Controls.Add(this.btnCopy);
			this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
			this.Name = "SystemInfoForm";
			this.Text = "システム情報";
			this.ResumeLayout(false);

		}
		#endregion

		private void btnOK_Click(object sender, System.EventArgs e)
		{
			Close();
		}

		protected override void OnLoad(EventArgs e)
		{
			base.OnLoad (e);
			sysInfoText.Text = ConfigureService.GetSystemInfo();
		}

		private void btnCopy_Click(object sender, System.EventArgs e)
		{
			string text = sysInfoText.Text;
			Clipboard.SetDataObject(text, true);
		}

	}
}
