using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using TeamXBMC.TranslatorCore;
namespace TeamXBMC.Translator
{
///
/// Summary description for UserForm.
///
public class UserForm : System.Windows.Forms.Form
{
private System.Windows.Forms.Button buttonOK;
private System.Windows.Forms.Button buttonCancel;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.TextBox textBoxName;
private System.Windows.Forms.TextBox textBoxEmail;
///
/// Required designer variable.
///
private System.ComponentModel.Container components = null;
public UserForm()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
//
// TODO: Add any constructor code after InitializeComponent call
//
}
///
/// Clean up any resources being used.
///
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows Form Designer generated code
///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///
private void InitializeComponent()
{
this.buttonOK = new System.Windows.Forms.Button();
this.buttonCancel = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.textBoxName = new System.Windows.Forms.TextBox();
this.textBoxEmail = new System.Windows.Forms.TextBox();
this.SuspendLayout();
//
// buttonOK
//
this.buttonOK.DialogResult = System.Windows.Forms.DialogResult.OK;
this.buttonOK.FlatStyle = System.Windows.Forms.FlatStyle.System;
this.buttonOK.Location = new System.Drawing.Point(120, 104);
this.buttonOK.Name = "buttonOK";
this.buttonOK.TabIndex = 5;
this.buttonOK.Text = "OK";
this.buttonOK.Click += new System.EventHandler(this.buttonOK_Click);
//
// buttonCancel
//
this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.buttonCancel.FlatStyle = System.Windows.Forms.FlatStyle.System;
this.buttonCancel.Location = new System.Drawing.Point(208, 104);
this.buttonCancel.Name = "buttonCancel";
this.buttonCancel.TabIndex = 6;
this.buttonCancel.Text = "Cancel";
//
// label1
//
this.label1.Location = new System.Drawing.Point(8, 40);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(56, 23);
this.label1.TabIndex = 1;
this.label1.Text = "Name:";
//
// label2
//
this.label2.Location = new System.Drawing.Point(8, 72);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(56, 23);
this.label2.TabIndex = 3;
this.label2.Text = "Email:";
//
// label3
//
this.label3.Location = new System.Drawing.Point(8, 8);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(272, 32);
this.label3.TabIndex = 0;
this.label3.Text = "Set your name and email adress (optional). They will be automatically saved to yo" +
"ur translation.";
//
// textBoxName
//
this.textBoxName.Location = new System.Drawing.Point(64, 40);
this.textBoxName.Name = "textBoxName";
this.textBoxName.Size = new System.Drawing.Size(216, 20);
this.textBoxName.TabIndex = 2;
this.textBoxName.Text = "";
//
// textBoxEmail
//
this.textBoxEmail.Location = new System.Drawing.Point(64, 72);
this.textBoxEmail.Name = "textBoxEmail";
this.textBoxEmail.Size = new System.Drawing.Size(216, 20);
this.textBoxEmail.TabIndex = 4;
this.textBoxEmail.Text = "";
//
// UserForm
//
this.AcceptButton = this.buttonOK;
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.CancelButton = this.buttonCancel;
this.ClientSize = new System.Drawing.Size(292, 136);
this.Controls.Add(this.textBoxEmail);
this.Controls.Add(this.textBoxName);
this.Controls.Add(this.label3);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.Controls.Add(this.buttonCancel);
this.Controls.Add(this.buttonOK);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "UserForm";
this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Translator Name";
this.Load += new System.EventHandler(this.UserForm_Load);
this.ResumeLayout(false);
}
#endregion
#region Form initialization
///
/// Sets the text of the controls from the settings values
///
private void UserForm_Load(object sender, System.EventArgs e)
{
textBoxName.Text=Settings.Instance.TranslatorName;
textBoxEmail.Text=Settings.Instance.TranslatorEmail;
}
#endregion
#region Control Events
///
/// Sets the settings values from the text of the controls
///
private void buttonOK_Click(object sender, System.EventArgs e)
{
Settings.Instance.TranslatorName=textBoxName.Text;
Settings.Instance.TranslatorEmail=textBoxEmail.Text;
DialogResult=DialogResult.OK;
Close();
}
#endregion
}
}