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

namespace KelimeEzber
{
	/// <summary>
	/// Summary description for Form_GenelAyarlar.
	/// </summary>
	public class Form_GenelAyarlar : System.Windows.Forms.Form
	{
		private System.Windows.Forms.GroupBox groupBox1;
		private System.Windows.Forms.CheckBox checkBox_SystemTray;
		private System.Windows.Forms.GroupBox groupBox_KelimeTekrar;
		private System.Windows.Forms.CheckBox checkBox_Sirali;
		private System.Windows.Forms.NumericUpDown numericUpDown2;
		private System.Windows.Forms.Label label6;
		private System.Windows.Forms.Button button_Sifirla;
		private System.Windows.Forms.GroupBox groupBox_KelimeBulmaOyunu;
		private System.Windows.Forms.NumericUpDown numericUpDown1;
		private System.Windows.Forms.Label label_SecenekAdet;
		private General.GenelAyarlar myAyarlar;
		private General.DataManager myDm = null;
		private System.Windows.Forms.CheckBox checkBox_Sesli;
		/// <summary>
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.Container components = null;

		public Form_GenelAyarlar()
		{
			//
			// Required for Windows Form Designer support
			//
			InitializeComponent();

			//
			// TODO: Add any constructor code after InitializeComponent call
			//
		}

		/// <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()
		{
			System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(Form_GenelAyarlar));
			this.groupBox1 = new System.Windows.Forms.GroupBox();
			this.button_Sifirla = new System.Windows.Forms.Button();
			this.checkBox_SystemTray = new System.Windows.Forms.CheckBox();
			this.groupBox_KelimeTekrar = new System.Windows.Forms.GroupBox();
			this.checkBox_Sirali = new System.Windows.Forms.CheckBox();
			this.numericUpDown2 = new System.Windows.Forms.NumericUpDown();
			this.label6 = new System.Windows.Forms.Label();
			this.groupBox_KelimeBulmaOyunu = new System.Windows.Forms.GroupBox();
			this.numericUpDown1 = new System.Windows.Forms.NumericUpDown();
			this.label_SecenekAdet = new System.Windows.Forms.Label();
			this.checkBox_Sesli = new System.Windows.Forms.CheckBox();
			this.groupBox1.SuspendLayout();
			this.groupBox_KelimeTekrar.SuspendLayout();
			((System.ComponentModel.ISupportInitialize)(this.numericUpDown2)).BeginInit();
			this.groupBox_KelimeBulmaOyunu.SuspendLayout();
			((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).BeginInit();
			this.SuspendLayout();
			// 
			// groupBox1
			// 
			this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
				| System.Windows.Forms.AnchorStyles.Right)));
			this.groupBox1.Controls.Add(this.checkBox_Sesli);
			this.groupBox1.Controls.Add(this.button_Sifirla);
			this.groupBox1.Controls.Add(this.checkBox_SystemTray);
			this.groupBox1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(162)));
			this.groupBox1.Location = new System.Drawing.Point(0, 0);
			this.groupBox1.Name = "groupBox1";
			this.groupBox1.Size = new System.Drawing.Size(320, 112);
			this.groupBox1.TabIndex = 0;
			this.groupBox1.TabStop = false;
			this.groupBox1.Text = "Ana Pencere İçin";
			// 
			// button_Sifirla
			// 
			this.button_Sifirla.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(162)));
			this.button_Sifirla.ForeColor = System.Drawing.Color.FromArgb(((System.Byte)(0)), ((System.Byte)(0)), ((System.Byte)(192)));
			this.button_Sifirla.Location = new System.Drawing.Point(8, 45);
			this.button_Sifirla.Name = "button_Sifirla";
			this.button_Sifirla.Size = new System.Drawing.Size(304, 23);
			this.button_Sifirla.TabIndex = 1;
			this.button_Sifirla.Text = "KELİME Bilindi Bilinemedi Bilgilerini Sıfırla";
			this.button_Sifirla.Click += new System.EventHandler(this.button_Sifirla_Click);
			// 
			// checkBox_SystemTray
			// 
			this.checkBox_SystemTray.ForeColor = System.Drawing.Color.FromArgb(((System.Byte)(0)), ((System.Byte)(0)), ((System.Byte)(192)));
			this.checkBox_SystemTray.Location = new System.Drawing.Point(8, 16);
			this.checkBox_SystemTray.Name = "checkBox_SystemTray";
			this.checkBox_SystemTray.Size = new System.Drawing.Size(232, 24);
			this.checkBox_SystemTray.TabIndex = 0;
			this.checkBox_SystemTray.Text = "Esc Tuşuna basıldığında pencereyi gizle";
			// 
			// groupBox_KelimeTekrar
			// 
			this.groupBox_KelimeTekrar.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
				| System.Windows.Forms.AnchorStyles.Right)));
			this.groupBox_KelimeTekrar.Controls.Add(this.checkBox_Sirali);
			this.groupBox_KelimeTekrar.Controls.Add(this.numericUpDown2);
			this.groupBox_KelimeTekrar.Controls.Add(this.label6);
			this.groupBox_KelimeTekrar.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(162)));
			this.groupBox_KelimeTekrar.Location = new System.Drawing.Point(0, 168);
			this.groupBox_KelimeTekrar.Name = "groupBox_KelimeTekrar";
			this.groupBox_KelimeTekrar.Size = new System.Drawing.Size(320, 69);
			this.groupBox_KelimeTekrar.TabIndex = 1;
			this.groupBox_KelimeTekrar.TabStop = false;
			this.groupBox_KelimeTekrar.Text = "Kelime Tekrar için";
			// 
			// checkBox_Sirali
			// 
			this.checkBox_Sirali.ForeColor = System.Drawing.Color.FromArgb(((System.Byte)(0)), ((System.Byte)(0)), ((System.Byte)(192)));
			this.checkBox_Sirali.Location = new System.Drawing.Point(72, 19);
			this.checkBox_Sirali.Name = "checkBox_Sirali";
			this.checkBox_Sirali.Size = new System.Drawing.Size(176, 24);
			this.checkBox_Sirali.TabIndex = 19;
			this.checkBox_Sirali.Text = "Sıralı Olarak Kelimelerde İlerle";
			// 
			// numericUpDown2
			// 
			this.numericUpDown2.ForeColor = System.Drawing.Color.Blue;
			this.numericUpDown2.Location = new System.Drawing.Point(193, 43);
			this.numericUpDown2.Maximum = new System.Decimal(new int[] {
																		   1000,
																		   0,
																		   0,
																		   0});
			this.numericUpDown2.Minimum = new System.Decimal(new int[] {
																		   1,
																		   0,
																		   0,
																		   0});
			this.numericUpDown2.Name = "numericUpDown2";
			this.numericUpDown2.Size = new System.Drawing.Size(53, 20);
			this.numericUpDown2.TabIndex = 18;
			this.numericUpDown2.Value = new System.Decimal(new int[] {
																		 1,
																		 0,
																		 0,
																		 0});
			// 
			// label6
			// 
			this.label6.ForeColor = System.Drawing.Color.FromArgb(((System.Byte)(0)), ((System.Byte)(0)), ((System.Byte)(192)));
			this.label6.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
			this.label6.Location = new System.Drawing.Point(49, 48);
			this.label6.Name = "label6";
			this.label6.Size = new System.Drawing.Size(144, 11);
			this.label6.TabIndex = 17;
			this.label6.Text = "Kelime Gösterme Süresi :";
			this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
			// 
			// groupBox_KelimeBulmaOyunu
			// 
			this.groupBox_KelimeBulmaOyunu.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
				| System.Windows.Forms.AnchorStyles.Right)));
			this.groupBox_KelimeBulmaOyunu.Controls.Add(this.numericUpDown1);
			this.groupBox_KelimeBulmaOyunu.Controls.Add(this.label_SecenekAdet);
			this.groupBox_KelimeBulmaOyunu.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(162)));
			this.groupBox_KelimeBulmaOyunu.Location = new System.Drawing.Point(0, 112);
			this.groupBox_KelimeBulmaOyunu.Name = "groupBox_KelimeBulmaOyunu";
			this.groupBox_KelimeBulmaOyunu.Size = new System.Drawing.Size(320, 50);
			this.groupBox_KelimeBulmaOyunu.TabIndex = 2;
			this.groupBox_KelimeBulmaOyunu.TabStop = false;
			this.groupBox_KelimeBulmaOyunu.Text = "Kelime Bulma Oyunu";
			// 
			// numericUpDown1
			// 
			this.numericUpDown1.ForeColor = System.Drawing.Color.Blue;
			this.numericUpDown1.Location = new System.Drawing.Point(188, 21);
			this.numericUpDown1.Minimum = new System.Decimal(new int[] {
																		   10,
																		   0,
																		   0,
																		   0});
			this.numericUpDown1.Name = "numericUpDown1";
			this.numericUpDown1.Size = new System.Drawing.Size(56, 20);
			this.numericUpDown1.TabIndex = 10;
			this.numericUpDown1.Value = new System.Decimal(new int[] {
																		 10,
																		 0,
																		 0,
																		 0});
			// 
			// label_SecenekAdet
			// 
			this.label_SecenekAdet.ForeColor = System.Drawing.Color.FromArgb(((System.Byte)(0)), ((System.Byte)(0)), ((System.Byte)(192)));
			this.label_SecenekAdet.Location = new System.Drawing.Point(48, 22);
			this.label_SecenekAdet.Name = "label_SecenekAdet";
			this.label_SecenekAdet.Size = new System.Drawing.Size(136, 16);
			this.label_SecenekAdet.TabIndex = 9;
			this.label_SecenekAdet.Text = "Soru Seçenekleri Adet :";
			this.label_SecenekAdet.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
			// 
			// checkBox_Sesli
			// 
			this.checkBox_Sesli.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(162)));
			this.checkBox_Sesli.Location = new System.Drawing.Point(10, 78);
			this.checkBox_Sesli.Name = "checkBox_Sesli";
			this.checkBox_Sesli.Size = new System.Drawing.Size(54, 24);
			this.checkBox_Sesli.TabIndex = 2;
			this.checkBox_Sesli.Text = "Sesli";
			// 
			// Form_GenelAyarlar
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
			this.ClientSize = new System.Drawing.Size(320, 237);
			this.Controls.Add(this.groupBox_KelimeBulmaOyunu);
			this.Controls.Add(this.groupBox_KelimeTekrar);
			this.Controls.Add(this.groupBox1);
			this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
			this.KeyPreview = true;
			this.Name = "Form_GenelAyarlar";
			this.Text = "Genel Ayarlar";
			this.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.Form_GenelAyarlar_KeyPress);
			this.Load += new System.EventHandler(this.Form_GenelAyarlar_Load);
			this.Closed += new System.EventHandler(this.Form_GenelAyarlar_Closed);
			this.groupBox1.ResumeLayout(false);
			this.groupBox_KelimeTekrar.ResumeLayout(false);
			((System.ComponentModel.ISupportInitialize)(this.numericUpDown2)).EndInit();
			this.groupBox_KelimeBulmaOyunu.ResumeLayout(false);
			((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).EndInit();
			this.ResumeLayout(false);

		}
		#endregion

		private void Form_GenelAyarlar_Load(object sender, System.EventArgs e)
		{
			myAyarlar = new KelimeEzber.General.GenelAyarlar();
			checkBox_Sirali.Checked = myAyarlar.bSiraliKelimeGoster;
			this.numericUpDown2.Value = Convert.ToDecimal(myAyarlar.iHiz);
			this.numericUpDown1.Value = Convert.ToDecimal(myAyarlar.iSecenekAdedi);
			this.checkBox_SystemTray.Checked = myAyarlar.bSystemTraydaGoster;
			this.checkBox_Sesli.Checked = myAyarlar.bSes;
		}

		private void Form_GenelAyarlar_Closed(object sender, System.EventArgs e)
		{
			myAyarlar.bSiraliKelimeGoster = checkBox_Sirali.Checked;
			myAyarlar.iSecenekAdedi = Convert.ToInt32(this.numericUpDown1.Value);
			myAyarlar.iHiz = Convert.ToInt32(this.numericUpDown2.Value);
			myAyarlar.bSystemTraydaGoster = this.checkBox_SystemTray.Checked;
			myAyarlar.bSes = this.checkBox_Sesli.Checked;
			myAyarlar.Dispose();
			myAyarlar = null;
		}

		private void Form_GenelAyarlar_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
		{
			if (e.KeyChar == 27) 
			{
				this.Close();
			}
		}

		private void button_Sifirla_Click(object sender, System.EventArgs e)
		{
			myDm = new General.DataManager();			
			myDm.OpenConn();
			myDm.sQuery = "Update SOZLUK Set KacDefaBilindi=0,KacDefaBilinemedi=0 ";
			myDm.sTableName = "SOZLUK";
			myDm.ExecuteQuery();
			MessageBox.Show("İşlem Başarı İle Tamamlandı.","Kelime Ezber Projesi");
			myDm.Dispose();
		}
	}
}
