-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNameSelect.cs
More file actions
131 lines (122 loc) · 3.69 KB
/
NameSelect.cs
File metadata and controls
131 lines (122 loc) · 3.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
namespace lilySharp
{
/// <summary>
/// Allows a user to pick their username from their reserved names list
/// </summary>
public class SelectName : System.Windows.Forms.Form
{
private System.Windows.Forms.ComboBox userNameBox;
private System.Windows.Forms.Button OkBtn;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.Button cancelBtn;
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null;
/// <summary>
/// Constructor
/// </summary>
/// <param name="nameList">Comma delimited list of reserved names</param>
public SelectName(string nameList)
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
//
// TODO: Add any constructor code after InitializeComponent call
//
this.userNameBox.Items.AddRange(nameList.Split( new char[] {','} ) );
this.userNameBox.SelectedIndex = 0;
}
/// <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.userNameBox = new System.Windows.Forms.ComboBox();
this.OkBtn = new System.Windows.Forms.Button();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.cancelBtn = new System.Windows.Forms.Button();
this.groupBox1.SuspendLayout();
this.SuspendLayout();
//
// userNameBox
//
this.userNameBox.Location = new System.Drawing.Point(24, 24);
this.userNameBox.Name = "userNameBox";
this.userNameBox.Size = new System.Drawing.Size(121, 21);
this.userNameBox.TabIndex = 1;
//
// OkBtn
//
this.OkBtn.DialogResult = System.Windows.Forms.DialogResult.OK;
this.OkBtn.Location = new System.Drawing.Point(112, 88);
this.OkBtn.Name = "OkBtn";
this.OkBtn.TabIndex = 2;
this.OkBtn.Text = "OK";
//
// groupBox1
//
this.groupBox1.Controls.AddRange(new System.Windows.Forms.Control[] {
this.userNameBox});
this.groupBox1.Location = new System.Drawing.Point(16, 8);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(168, 64);
this.groupBox1.TabIndex = 3;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "Select a Name";
//
// cancelBtn
//
this.cancelBtn.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.cancelBtn.Location = new System.Drawing.Point(16, 88);
this.cancelBtn.Name = "cancelBtn";
this.cancelBtn.TabIndex = 4;
this.cancelBtn.Text = "Cancel";
//
// SelectName
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(208, 133);
this.Controls.AddRange(new System.Windows.Forms.Control[] {
this.cancelBtn,
this.groupBox1,
this.OkBtn});
this.Name = "SelectName";
this.Text = "IUser Name Selection";
this.groupBox1.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
/// <summary>
///
/// </summary>
public string UserName
{
get
{ return userNameBox.Items[userNameBox.SelectedIndex] as string; }
}
}
}