using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
namespace AnonymousMail
{
/// <summary>
/// Summary description for Setting.
/// </summary>
public class Setting : System.Windows.Forms.Form
{
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.RadioButton highRB;
private System.Windows.Forms.RadioButton normalRB;
private System.Windows.Forms.RadioButton lowRB;
private System.Windows.Forms.RadioButton asciiRB;
private System.Windows.Forms.RadioButton unicodeRB;
private System.Windows.Forms.RadioButton utf7RB;
private System.Windows.Forms.RadioButton utf8RB;
private System.Windows.Forms.Button okBtn;
private System.Windows.Forms.Button cancelBtn;
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null;
private Priorities prEnum;
private Encodings edEnum;
private Priorities storePrEnum;
private Encodings storeEdEnum;
private static bool okClicked;
public Setting()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
//
// TODO: Add any constructor code after InitializeComponent call
//
reset();
}
/// <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(Setting
));
this.
groupBox1 = new System.
Windows.
Forms.
GroupBox();
this.
lowRB = new System.
Windows.
Forms.
RadioButton();
this.
normalRB = new System.
Windows.
Forms.
RadioButton();
this.
highRB = new System.
Windows.
Forms.
RadioButton();
this.
groupBox2 = new System.
Windows.
Forms.
GroupBox();
this.
utf8RB = new System.
Windows.
Forms.
RadioButton();
this.
utf7RB = new System.
Windows.
Forms.
RadioButton();
this.
unicodeRB = new System.
Windows.
Forms.
RadioButton();
this.
asciiRB = new System.
Windows.
Forms.
RadioButton();
this.
okBtn = new System.
Windows.
Forms.
Button();
this.
cancelBtn = new System.
Windows.
Forms.
Button();
this.groupBox1.SuspendLayout();
this.groupBox2.SuspendLayout();
this.SuspendLayout();
//
// groupBox1
//
this.groupBox1.BackColor = System.Drawing.Color.Transparent;
this.groupBox1.Controls.Add(this.lowRB);
this.groupBox1.Controls.Add(this.normalRB);
this.groupBox1.Controls.Add(this.highRB);
this.
groupBox1.
Font = new System.Drawing.
Font("Comic Sans MS", 9.75F,
System.Drawing.
FontStyle.
Bold,
System.Drawing.
GraphicsUnit.
Point,
((System.
Byte)(0
)));
this.groupBox1.ForeColor = System.Drawing.Color.FromArgb(((System.Byte)(128)), ((System.Byte)(255)), ((System.Byte)(128)));
this.
groupBox1.
Location = new System.Drawing.
Point(24, 24
);
this.groupBox1.Name = "groupBox1";
this.
groupBox1.
Size = new System.Drawing.
Size(128, 152
);
this.groupBox1.TabIndex = 0;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "Priorità";
//
// lowRB
//
this.
lowRB.
Location = new System.Drawing.
Point(16, 104
);
this.lowRB.Name = "lowRB";
this.lowRB.TabIndex = 2;
this.lowRB.Text = "Bassa";
//
// normalRB
//
this.
normalRB.
Location = new System.Drawing.
Point(16, 64
);
this.normalRB.Name = "normalRB";
this.normalRB.TabIndex = 1;
this.normalRB.Text = "Normale";
//
// highRB
//
this.
highRB.
Location = new System.Drawing.
Point(16, 32
);
this.highRB.Name = "highRB";
this.
highRB.
Size = new System.Drawing.
Size(72, 16
);
this.highRB.TabIndex = 0;
this.highRB.Text = "Alta";
//
// groupBox2
//
this.groupBox2.BackColor = System.Drawing.Color.Transparent;
this.groupBox2.Controls.Add(this.utf8RB);
this.groupBox2.Controls.Add(this.utf7RB);
this.groupBox2.Controls.Add(this.unicodeRB);
this.groupBox2.Controls.Add(this.asciiRB);
this.
groupBox2.
Font = new System.Drawing.
Font("Comic Sans MS", 9.75F,
System.Drawing.
FontStyle.
Bold,
System.Drawing.
GraphicsUnit.
Point,
((System.
Byte)(0
)));
this.groupBox2.ForeColor = System.Drawing.Color.FromArgb(((System.Byte)(128)), ((System.Byte)(255)), ((System.Byte)(128)));
this.
groupBox2.
Location = new System.Drawing.
Point(184, 24
);
this.groupBox2.Name = "groupBox2";
this.
groupBox2.
Size = new System.Drawing.
Size(128, 184
);
this.groupBox2.TabIndex = 1;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "Encoding";
//
// utf8RB
//
this.
utf8RB.
Location = new System.Drawing.
Point(16, 144
);
this.utf8RB.Name = "utf8RB";
this.utf8RB.TabIndex = 3;
this.utf8RB.Text = "UTF8";
//
// utf7RB
//
this.
utf7RB.
Location = new System.Drawing.
Point(16, 104
);
this.utf7RB.Name = "utf7RB";
this.utf7RB.TabIndex = 2;
this.utf7RB.Text = "UTF7";
//
// unicodeRB
//
this.
unicodeRB.
Location = new System.Drawing.
Point(16, 64
);
this.unicodeRB.Name = "unicodeRB";
this.unicodeRB.TabIndex = 1;
this.unicodeRB.Text = "Unicode";
//
// asciiRB
//
this.
asciiRB.
Location = new System.Drawing.
Point(16, 32
);
this.asciiRB.Name = "asciiRB";
this.asciiRB.TabIndex = 0;
this.asciiRB.Text = "ASCII";
//
// okBtn
//
this.okBtn.BackColor = System.Drawing.Color.Transparent;
this.
okBtn.
Font = new System.Drawing.
Font("Comic Sans MS", 12F,
System.Drawing.
FontStyle.
Bold,
System.Drawing.
GraphicsUnit.
Point,
((System.
Byte)(0
)));
this.okBtn.ForeColor = System.Drawing.Color.FromArgb(((System.Byte)(128)), ((System.Byte)(255)), ((System.Byte)(128)));
this.
okBtn.
Location = new System.Drawing.
Point(72, 240
);
this.okBtn.Name = "okBtn";
this.okBtn.TabIndex = 2;
this.okBtn.Text = "OK";
this.
okBtn.
Click += new System.
EventHandler(this.
okBtn_Click);
//
// cancelBtn
//
this.cancelBtn.BackColor = System.Drawing.Color.Transparent;
this.
cancelBtn.
Font = new System.Drawing.
Font("Comic Sans MS", 12F,
System.Drawing.
FontStyle.
Bold,
System.Drawing.
GraphicsUnit.
Point,
((System.
Byte)(0
)));
this.cancelBtn.ForeColor = System.Drawing.Color.FromArgb(((System.Byte)(128)), ((System.Byte)(255)), ((System.Byte)(128)));
this.
cancelBtn.
Location = new System.Drawing.
Point(200, 240
);
this.cancelBtn.Name = "cancelBtn";
this.
cancelBtn.
Size = new System.Drawing.
Size(80, 23
);
this.cancelBtn.TabIndex = 3;
this.cancelBtn.Text = "Cancella";
this.
cancelBtn.
Click += new System.
EventHandler(this.
cancelBtn_Click);
//
// Setting
//
this.
AutoScaleBaseSize = new System.Drawing.
Size(5, 13
);
this.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("$this.BackgroundImage")));
this.
ClientSize = new System.Drawing.
Size(344, 286
);
this.Controls.Add(this.cancelBtn);
this.Controls.Add(this.okBtn);
this.Controls.Add(this.groupBox2);
this.Controls.Add(this.groupBox1);
this.MaximizeBox = false;
this.Name = "Setting";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Settaggi";
this.
Closing += new System.ComponentModel.
CancelEventHandler(this.
closingEvent);
this.
Load += new System.
EventHandler(this.
Setting_Load);
this.
VisibleChanged += new System.
EventHandler(this.
visibleChange);
this.groupBox1.ResumeLayout(false);
this.groupBox2.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private void okBtn_Click(object sender, System.EventArgs e)
{
{
PrEnum = Priorities.High;
}
{
PrEnum = Priorities.Normal;
}
else
{
PrEnum = Priorities.Low;
}
{
EdEnum = Encodings.ASCII;
}
{
EdEnum = Encodings.Unicode;
}
{
EdEnum = Encodings.UTF7;
}
else
{
EdEnum = Encodings.UTF8;
}
okClicked = true;
this.Close();
}
private void reset()
{
PrEnum = Priorities.Normal;
EdEnum = Encodings.UTF8;
}
private void cancelBtn_Click(object sender, System.EventArgs e)
{
backToPrevious();
this.Close();
}
public Priorities PrEnum
{
get
{
return prEnum;
}
set
{
prEnum = value;
}
}
public Encodings EdEnum
{
get
{
return edEnum;
}
set
{
edEnum = value;
}
}
private void backToPrevious()
{
switch (storePrEnum)
{
case Priorities.High:
break;
case Priorities.Normal:
break;
case Priorities.Low:
break;
}
switch (storeEdEnum)
{
case Encodings.ASCII:
break;
case Encodings.Unicode:
break;
case Encodings.UTF7:
break;
case Encodings.UTF8:
break;
}
}
private void visibleChange(object sender, System.EventArgs e)
{
storePrEnum = prEnum;
storeEdEnum = edEnum;
okClicked = false;
}
private void closingEvent(object sender, System.ComponentModel.CancelEventArgs e)
{
if (okClicked == false)
backToPrevious();
}
private void Setting_Load(object sender, System.EventArgs e)
{
}
}
}