2004-05-22 Francisco Figueiredo Jr. <fxjrlists@yahoo.com.br>
[mono.git] / mcs / class / Npgsql / Npgsql / Design / ConnectionStringEditorForm.cs
1 using System;
2 using System.Data;
3 using System.Net;
4 using System.Net.Sockets;
5 using System.IO;
6 using System.Text;
7 using System.ComponentModel;
8 using System.Collections;
9 using System.Collections.Specialized;
10 using System.Windows.Forms;
11 using System.Drawing.Design;
12 using System.Windows.Forms.Design;
13
14 namespace Npgsql.Design {
15         internal class ConnectionStringEditorForm : System.Windows.Forms.Form {
16                 private System.Windows.Forms.TabControl tc_main;
17                 private System.Windows.Forms.TabPage tp_connection;
18                 private System.Windows.Forms.Label lab_advise;
19                 private System.Windows.Forms.Label lab_login;
20                 private System.Windows.Forms.Label lab_username;
21                 private System.Windows.Forms.TextBox tb_username;
22                 private System.Windows.Forms.Label lab_select_db;
23                 private System.Windows.Forms.ComboBox cb_select_db;
24                 private System.Windows.Forms.GroupBox gb_add_parms;
25                 private System.Windows.Forms.Label lab_timeout;
26                 private System.Windows.Forms.TextBox tb_timeout;
27                 private System.Windows.Forms.Button btn_check_connection;
28                 private System.Windows.Forms.Button btn_ok;
29                 private System.Windows.Forms.Button btn_cancel;
30                 private System.Windows.Forms.Button btn_help;
31                 private System.Windows.Forms.Label lab_port;
32                 private System.Windows.Forms.TextBox tb_port;
33                 private System.Windows.Forms.Label lab_server;
34                 private System.Windows.Forms.TextBox tb_server;
35                 private System.Windows.Forms.TextBox tb_password;
36                 private System.Windows.Forms.Button btn_refresh;
37                 private System.Windows.Forms.Label lab_password;
38                 private System.Resources.ResourceManager resman;
39
40                 private Npgsql.NpgsqlConnection pgconn;
41
42                 /// <summary>
43                 /// Required designer variable.
44                 /// </summary>
45                 private System.ComponentModel.Container components = null;
46
47                 public ConnectionStringEditorForm() {
48                         InitializeComponent();
49                         // Attention: The localization-issues don't only affect the surface but also affect some
50                         // MessageBoxes which have to be localized too - look for resman!
51                         resman = new System.Resources.ResourceManager(typeof(ConnectionStringEditorForm));
52                 }
53
54                 public ConnectionStringEditorForm(String ConnectionString) : this(){
55                         this.pgconn.ConnectionString = ConnectionString;
56                         this.tb_password.Text = this.pgconn.connection_string_values[this.pgconn.CONN_PASSWORD] == null ? String.Empty : this.pgconn.connection_string_values[this.pgconn.CONN_PASSWORD].ToString();
57                         this.tb_port.Text = this.pgconn.connection_string_values[this.pgconn.CONN_PORT] == null ? String.Empty : this.pgconn.connection_string_values[this.pgconn.CONN_PORT].ToString();
58                         this.tb_server.Text = this.pgconn.connection_string_values[this.pgconn.CONN_SERVER] == null ? String.Empty : this.pgconn.connection_string_values[this.pgconn.CONN_SERVER].ToString();
59                         this.tb_username.Text = this.pgconn.connection_string_values[this.pgconn.CONN_USERID] == null ? String.Empty : this.pgconn.connection_string_values[this.pgconn.CONN_USERID].ToString();
60                         this.tb_timeout.Text = this.pgconn.ConnectionTimeout.ToString();
61                         if(this.pgconn.connection_string_values[this.pgconn.CONN_DATABASE] != null){
62                                 this.cb_select_db.Items.Add(this.pgconn.connection_string_values[this.pgconn.CONN_DATABASE].ToString());
63                                 this.cb_select_db.SelectedIndex = 0;
64                         }
65                 }
66
67                 /// <summary>
68                 /// Clean up any resources being used.
69                 /// </summary>
70                 protected override void Dispose( bool disposing ) {
71                         if( disposing ) {
72                                 if(components != null) {
73                                         components.Dispose();
74                                 }
75                         }
76                         base.Dispose( disposing );
77                 }
78
79                 #region Windows Form Designer generated code
80                 /// <summary>
81                 /// Required method for Designer support - do not modify
82                 /// the contents of this method with the code editor.
83                 /// </summary>
84                 private void InitializeComponent() {
85                         System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(ConnectionStringEditorForm));
86                         this.tc_main = new System.Windows.Forms.TabControl();
87                         this.tp_connection = new System.Windows.Forms.TabPage();
88                         this.btn_refresh = new System.Windows.Forms.Button();
89                         this.tb_server = new System.Windows.Forms.TextBox();
90                         this.btn_check_connection = new System.Windows.Forms.Button();
91                         this.gb_add_parms = new System.Windows.Forms.GroupBox();
92                         this.tb_port = new System.Windows.Forms.TextBox();
93                         this.lab_port = new System.Windows.Forms.Label();
94                         this.tb_timeout = new System.Windows.Forms.TextBox();
95                         this.lab_timeout = new System.Windows.Forms.Label();
96                         this.cb_select_db = new System.Windows.Forms.ComboBox();
97                         this.lab_select_db = new System.Windows.Forms.Label();
98                         this.tb_password = new System.Windows.Forms.TextBox();
99                         this.lab_password = new System.Windows.Forms.Label();
100                         this.tb_username = new System.Windows.Forms.TextBox();
101                         this.lab_username = new System.Windows.Forms.Label();
102                         this.lab_login = new System.Windows.Forms.Label();
103                         this.lab_server = new System.Windows.Forms.Label();
104                         this.lab_advise = new System.Windows.Forms.Label();
105                         this.btn_ok = new System.Windows.Forms.Button();
106                         this.btn_cancel = new System.Windows.Forms.Button();
107                         this.btn_help = new System.Windows.Forms.Button();
108                         this.pgconn = new Npgsql.NpgsqlConnection();
109                         this.tc_main.SuspendLayout();
110                         this.tp_connection.SuspendLayout();
111                         this.gb_add_parms.SuspendLayout();
112                         this.SuspendLayout();
113                         // 
114                         // tc_main
115                         // 
116                         this.tc_main.AccessibleDescription = ((string)(resources.GetObject("tc_main.AccessibleDescription")));
117                         this.tc_main.AccessibleName = ((string)(resources.GetObject("tc_main.AccessibleName")));
118                         this.tc_main.Alignment = ((System.Windows.Forms.TabAlignment)(resources.GetObject("tc_main.Alignment")));
119                         this.tc_main.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("tc_main.Anchor")));
120                         this.tc_main.Appearance = ((System.Windows.Forms.TabAppearance)(resources.GetObject("tc_main.Appearance")));
121                         this.tc_main.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("tc_main.BackgroundImage")));
122                         this.tc_main.Controls.AddRange(new System.Windows.Forms.Control[] {
123                                                                                                                                                                                                                                                                                                         this.tp_connection});
124                         this.tc_main.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("tc_main.Dock")));
125                         this.tc_main.Enabled = ((bool)(resources.GetObject("tc_main.Enabled")));
126                         this.tc_main.Font = ((System.Drawing.Font)(resources.GetObject("tc_main.Font")));
127                         this.tc_main.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("tc_main.ImeMode")));
128                         this.tc_main.ItemSize = ((System.Drawing.Size)(resources.GetObject("tc_main.ItemSize")));
129                         this.tc_main.Location = ((System.Drawing.Point)(resources.GetObject("tc_main.Location")));
130                         this.tc_main.Name = "tc_main";
131                         this.tc_main.Padding = ((System.Drawing.Point)(resources.GetObject("tc_main.Padding")));
132                         this.tc_main.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("tc_main.RightToLeft")));
133                         this.tc_main.SelectedIndex = 0;
134                         this.tc_main.ShowToolTips = ((bool)(resources.GetObject("tc_main.ShowToolTips")));
135                         this.tc_main.Size = ((System.Drawing.Size)(resources.GetObject("tc_main.Size")));
136                         this.tc_main.TabIndex = ((int)(resources.GetObject("tc_main.TabIndex")));
137                         this.tc_main.Text = resources.GetString("tc_main.Text");
138                         this.tc_main.Visible = ((bool)(resources.GetObject("tc_main.Visible")));
139                         // 
140                         // tp_connection
141                         // 
142                         this.tp_connection.AccessibleDescription = ((string)(resources.GetObject("tp_connection.AccessibleDescription")));
143                         this.tp_connection.AccessibleName = ((string)(resources.GetObject("tp_connection.AccessibleName")));
144                         this.tp_connection.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("tp_connection.Anchor")));
145                         this.tp_connection.AutoScroll = ((bool)(resources.GetObject("tp_connection.AutoScroll")));
146                         this.tp_connection.AutoScrollMargin = ((System.Drawing.Size)(resources.GetObject("tp_connection.AutoScrollMargin")));
147                         this.tp_connection.AutoScrollMinSize = ((System.Drawing.Size)(resources.GetObject("tp_connection.AutoScrollMinSize")));
148                         this.tp_connection.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("tp_connection.BackgroundImage")));
149                         this.tp_connection.Controls.AddRange(new System.Windows.Forms.Control[] {
150                                                                                                                                                                                                                                                                                                                                 this.btn_refresh,
151                                                                                                                                                                                                                                                                                                                                 this.tb_server,
152                                                                                                                                                                                                                                                                                                                                 this.btn_check_connection,
153                                                                                                                                                                                                                                                                                                                                 this.gb_add_parms,
154                                                                                                                                                                                                                                                                                                                                 this.cb_select_db,
155                                                                                                                                                                                                                                                                                                                                 this.lab_select_db,
156                                                                                                                                                                                                                                                                                                                                 this.tb_password,
157                                                                                                                                                                                                                                                                                                                                 this.lab_password,
158                                                                                                                                                                                                                                                                                                                                 this.tb_username,
159                                                                                                                                                                                                                                                                                                                                 this.lab_username,
160                                                                                                                                                                                                                                                                                                                                 this.lab_login,
161                                                                                                                                                                                                                                                                                                                                 this.lab_server,
162                                                                                                                                                                                                                                                                                                                                 this.lab_advise});
163                         this.tp_connection.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("tp_connection.Dock")));
164                         this.tp_connection.Enabled = ((bool)(resources.GetObject("tp_connection.Enabled")));
165                         this.tp_connection.Font = ((System.Drawing.Font)(resources.GetObject("tp_connection.Font")));
166                         this.tp_connection.ImageIndex = ((int)(resources.GetObject("tp_connection.ImageIndex")));
167                         this.tp_connection.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("tp_connection.ImeMode")));
168                         this.tp_connection.Location = ((System.Drawing.Point)(resources.GetObject("tp_connection.Location")));
169                         this.tp_connection.Name = "tp_connection";
170                         this.tp_connection.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("tp_connection.RightToLeft")));
171                         this.tp_connection.Size = ((System.Drawing.Size)(resources.GetObject("tp_connection.Size")));
172                         this.tp_connection.TabIndex = ((int)(resources.GetObject("tp_connection.TabIndex")));
173                         this.tp_connection.Text = resources.GetString("tp_connection.Text");
174                         this.tp_connection.ToolTipText = resources.GetString("tp_connection.ToolTipText");
175                         this.tp_connection.Visible = ((bool)(resources.GetObject("tp_connection.Visible")));
176                         // 
177                         // btn_refresh
178                         // 
179                         this.btn_refresh.AccessibleDescription = ((string)(resources.GetObject("btn_refresh.AccessibleDescription")));
180                         this.btn_refresh.AccessibleName = ((string)(resources.GetObject("btn_refresh.AccessibleName")));
181                         this.btn_refresh.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("btn_refresh.Anchor")));
182                         this.btn_refresh.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btn_refresh.BackgroundImage")));
183                         this.btn_refresh.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("btn_refresh.Dock")));
184                         this.btn_refresh.Enabled = ((bool)(resources.GetObject("btn_refresh.Enabled")));
185                         this.btn_refresh.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("btn_refresh.FlatStyle")));
186                         this.btn_refresh.Font = ((System.Drawing.Font)(resources.GetObject("btn_refresh.Font")));
187                         this.btn_refresh.Image = ((System.Drawing.Image)(resources.GetObject("btn_refresh.Image")));
188                         this.btn_refresh.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btn_refresh.ImageAlign")));
189                         this.btn_refresh.ImageIndex = ((int)(resources.GetObject("btn_refresh.ImageIndex")));
190                         this.btn_refresh.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("btn_refresh.ImeMode")));
191                         this.btn_refresh.Location = ((System.Drawing.Point)(resources.GetObject("btn_refresh.Location")));
192                         this.btn_refresh.Name = "btn_refresh";
193                         this.btn_refresh.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("btn_refresh.RightToLeft")));
194                         this.btn_refresh.Size = ((System.Drawing.Size)(resources.GetObject("btn_refresh.Size")));
195                         this.btn_refresh.TabIndex = ((int)(resources.GetObject("btn_refresh.TabIndex")));
196                         this.btn_refresh.Text = resources.GetString("btn_refresh.Text");
197                         this.btn_refresh.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btn_refresh.TextAlign")));
198                         this.btn_refresh.Visible = ((bool)(resources.GetObject("btn_refresh.Visible")));
199                         this.btn_refresh.Click += new System.EventHandler(this.btn_refresh_Click);
200                         // 
201                         // tb_server
202                         // 
203                         this.tb_server.AccessibleDescription = ((string)(resources.GetObject("tb_server.AccessibleDescription")));
204                         this.tb_server.AccessibleName = ((string)(resources.GetObject("tb_server.AccessibleName")));
205                         this.tb_server.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("tb_server.Anchor")));
206                         this.tb_server.AutoSize = ((bool)(resources.GetObject("tb_server.AutoSize")));
207                         this.tb_server.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("tb_server.BackgroundImage")));
208                         this.tb_server.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("tb_server.Dock")));
209                         this.tb_server.Enabled = ((bool)(resources.GetObject("tb_server.Enabled")));
210                         this.tb_server.Font = ((System.Drawing.Font)(resources.GetObject("tb_server.Font")));
211                         this.tb_server.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("tb_server.ImeMode")));
212                         this.tb_server.Location = ((System.Drawing.Point)(resources.GetObject("tb_server.Location")));
213                         this.tb_server.MaxLength = ((int)(resources.GetObject("tb_server.MaxLength")));
214                         this.tb_server.Multiline = ((bool)(resources.GetObject("tb_server.Multiline")));
215                         this.tb_server.Name = "tb_server";
216                         this.tb_server.PasswordChar = ((char)(resources.GetObject("tb_server.PasswordChar")));
217                         this.tb_server.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("tb_server.RightToLeft")));
218                         this.tb_server.ScrollBars = ((System.Windows.Forms.ScrollBars)(resources.GetObject("tb_server.ScrollBars")));
219                         this.tb_server.Size = ((System.Drawing.Size)(resources.GetObject("tb_server.Size")));
220                         this.tb_server.TabIndex = ((int)(resources.GetObject("tb_server.TabIndex")));
221                         this.tb_server.Text = resources.GetString("tb_server.Text");
222                         this.tb_server.TextAlign = ((System.Windows.Forms.HorizontalAlignment)(resources.GetObject("tb_server.TextAlign")));
223                         this.tb_server.Visible = ((bool)(resources.GetObject("tb_server.Visible")));
224                         this.tb_server.WordWrap = ((bool)(resources.GetObject("tb_server.WordWrap")));
225                         // 
226                         // btn_check_connection
227                         // 
228                         this.btn_check_connection.AccessibleDescription = ((string)(resources.GetObject("btn_check_connection.AccessibleDescription")));
229                         this.btn_check_connection.AccessibleName = ((string)(resources.GetObject("btn_check_connection.AccessibleName")));
230                         this.btn_check_connection.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("btn_check_connection.Anchor")));
231                         this.btn_check_connection.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btn_check_connection.BackgroundImage")));
232                         this.btn_check_connection.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("btn_check_connection.Dock")));
233                         this.btn_check_connection.Enabled = ((bool)(resources.GetObject("btn_check_connection.Enabled")));
234                         this.btn_check_connection.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("btn_check_connection.FlatStyle")));
235                         this.btn_check_connection.Font = ((System.Drawing.Font)(resources.GetObject("btn_check_connection.Font")));
236                         this.btn_check_connection.Image = ((System.Drawing.Image)(resources.GetObject("btn_check_connection.Image")));
237                         this.btn_check_connection.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btn_check_connection.ImageAlign")));
238                         this.btn_check_connection.ImageIndex = ((int)(resources.GetObject("btn_check_connection.ImageIndex")));
239                         this.btn_check_connection.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("btn_check_connection.ImeMode")));
240                         this.btn_check_connection.Location = ((System.Drawing.Point)(resources.GetObject("btn_check_connection.Location")));
241                         this.btn_check_connection.Name = "btn_check_connection";
242                         this.btn_check_connection.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("btn_check_connection.RightToLeft")));
243                         this.btn_check_connection.Size = ((System.Drawing.Size)(resources.GetObject("btn_check_connection.Size")));
244                         this.btn_check_connection.TabIndex = ((int)(resources.GetObject("btn_check_connection.TabIndex")));
245                         this.btn_check_connection.Text = resources.GetString("btn_check_connection.Text");
246                         this.btn_check_connection.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btn_check_connection.TextAlign")));
247                         this.btn_check_connection.Visible = ((bool)(resources.GetObject("btn_check_connection.Visible")));
248                         this.btn_check_connection.Click += new System.EventHandler(this.btn_check_connection_Click);
249                         // 
250                         // gb_add_parms
251                         // 
252                         this.gb_add_parms.AccessibleDescription = ((string)(resources.GetObject("gb_add_parms.AccessibleDescription")));
253                         this.gb_add_parms.AccessibleName = ((string)(resources.GetObject("gb_add_parms.AccessibleName")));
254                         this.gb_add_parms.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("gb_add_parms.Anchor")));
255                         this.gb_add_parms.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("gb_add_parms.BackgroundImage")));
256                         this.gb_add_parms.Controls.AddRange(new System.Windows.Forms.Control[] {
257                                                                                                                                                                                                                                                                                                                          this.tb_port,
258                                                                                                                                                                                                                                                                                                                          this.lab_port,
259                                                                                                                                                                                                                                                                                                                          this.tb_timeout,
260                                                                                                                                                                                                                                                                                                                          this.lab_timeout});
261                         this.gb_add_parms.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("gb_add_parms.Dock")));
262                         this.gb_add_parms.Enabled = ((bool)(resources.GetObject("gb_add_parms.Enabled")));
263                         this.gb_add_parms.Font = ((System.Drawing.Font)(resources.GetObject("gb_add_parms.Font")));
264                         this.gb_add_parms.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("gb_add_parms.ImeMode")));
265                         this.gb_add_parms.Location = ((System.Drawing.Point)(resources.GetObject("gb_add_parms.Location")));
266                         this.gb_add_parms.Name = "gb_add_parms";
267                         this.gb_add_parms.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("gb_add_parms.RightToLeft")));
268                         this.gb_add_parms.Size = ((System.Drawing.Size)(resources.GetObject("gb_add_parms.Size")));
269                         this.gb_add_parms.TabIndex = ((int)(resources.GetObject("gb_add_parms.TabIndex")));
270                         this.gb_add_parms.TabStop = false;
271                         this.gb_add_parms.Text = resources.GetString("gb_add_parms.Text");
272                         this.gb_add_parms.Visible = ((bool)(resources.GetObject("gb_add_parms.Visible")));
273                         // 
274                         // tb_port
275                         // 
276                         this.tb_port.AccessibleDescription = ((string)(resources.GetObject("tb_port.AccessibleDescription")));
277                         this.tb_port.AccessibleName = ((string)(resources.GetObject("tb_port.AccessibleName")));
278                         this.tb_port.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("tb_port.Anchor")));
279                         this.tb_port.AutoSize = ((bool)(resources.GetObject("tb_port.AutoSize")));
280                         this.tb_port.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("tb_port.BackgroundImage")));
281                         this.tb_port.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("tb_port.Dock")));
282                         this.tb_port.Enabled = ((bool)(resources.GetObject("tb_port.Enabled")));
283                         this.tb_port.Font = ((System.Drawing.Font)(resources.GetObject("tb_port.Font")));
284                         this.tb_port.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("tb_port.ImeMode")));
285                         this.tb_port.Location = ((System.Drawing.Point)(resources.GetObject("tb_port.Location")));
286                         this.tb_port.MaxLength = ((int)(resources.GetObject("tb_port.MaxLength")));
287                         this.tb_port.Multiline = ((bool)(resources.GetObject("tb_port.Multiline")));
288                         this.tb_port.Name = "tb_port";
289                         this.tb_port.PasswordChar = ((char)(resources.GetObject("tb_port.PasswordChar")));
290                         this.tb_port.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("tb_port.RightToLeft")));
291                         this.tb_port.ScrollBars = ((System.Windows.Forms.ScrollBars)(resources.GetObject("tb_port.ScrollBars")));
292                         this.tb_port.Size = ((System.Drawing.Size)(resources.GetObject("tb_port.Size")));
293                         this.tb_port.TabIndex = ((int)(resources.GetObject("tb_port.TabIndex")));
294                         this.tb_port.Text = resources.GetString("tb_port.Text");
295                         this.tb_port.TextAlign = ((System.Windows.Forms.HorizontalAlignment)(resources.GetObject("tb_port.TextAlign")));
296                         this.tb_port.Visible = ((bool)(resources.GetObject("tb_port.Visible")));
297                         this.tb_port.WordWrap = ((bool)(resources.GetObject("tb_port.WordWrap")));
298                         // 
299                         // lab_port
300                         // 
301                         this.lab_port.AccessibleDescription = ((string)(resources.GetObject("lab_port.AccessibleDescription")));
302                         this.lab_port.AccessibleName = ((string)(resources.GetObject("lab_port.AccessibleName")));
303                         this.lab_port.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("lab_port.Anchor")));
304                         this.lab_port.AutoSize = ((bool)(resources.GetObject("lab_port.AutoSize")));
305                         this.lab_port.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("lab_port.Dock")));
306                         this.lab_port.Enabled = ((bool)(resources.GetObject("lab_port.Enabled")));
307                         this.lab_port.Font = ((System.Drawing.Font)(resources.GetObject("lab_port.Font")));
308                         this.lab_port.Image = ((System.Drawing.Image)(resources.GetObject("lab_port.Image")));
309                         this.lab_port.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lab_port.ImageAlign")));
310                         this.lab_port.ImageIndex = ((int)(resources.GetObject("lab_port.ImageIndex")));
311                         this.lab_port.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("lab_port.ImeMode")));
312                         this.lab_port.Location = ((System.Drawing.Point)(resources.GetObject("lab_port.Location")));
313                         this.lab_port.Name = "lab_port";
314                         this.lab_port.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("lab_port.RightToLeft")));
315                         this.lab_port.Size = ((System.Drawing.Size)(resources.GetObject("lab_port.Size")));
316                         this.lab_port.TabIndex = ((int)(resources.GetObject("lab_port.TabIndex")));
317                         this.lab_port.Text = resources.GetString("lab_port.Text");
318                         this.lab_port.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lab_port.TextAlign")));
319                         this.lab_port.Visible = ((bool)(resources.GetObject("lab_port.Visible")));
320                         // 
321                         // tb_timeout
322                         // 
323                         this.tb_timeout.AccessibleDescription = ((string)(resources.GetObject("tb_timeout.AccessibleDescription")));
324                         this.tb_timeout.AccessibleName = ((string)(resources.GetObject("tb_timeout.AccessibleName")));
325                         this.tb_timeout.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("tb_timeout.Anchor")));
326                         this.tb_timeout.AutoSize = ((bool)(resources.GetObject("tb_timeout.AutoSize")));
327                         this.tb_timeout.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("tb_timeout.BackgroundImage")));
328                         this.tb_timeout.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("tb_timeout.Dock")));
329                         this.tb_timeout.Enabled = ((bool)(resources.GetObject("tb_timeout.Enabled")));
330                         this.tb_timeout.Font = ((System.Drawing.Font)(resources.GetObject("tb_timeout.Font")));
331                         this.tb_timeout.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("tb_timeout.ImeMode")));
332                         this.tb_timeout.Location = ((System.Drawing.Point)(resources.GetObject("tb_timeout.Location")));
333                         this.tb_timeout.MaxLength = ((int)(resources.GetObject("tb_timeout.MaxLength")));
334                         this.tb_timeout.Multiline = ((bool)(resources.GetObject("tb_timeout.Multiline")));
335                         this.tb_timeout.Name = "tb_timeout";
336                         this.tb_timeout.PasswordChar = ((char)(resources.GetObject("tb_timeout.PasswordChar")));
337                         this.tb_timeout.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("tb_timeout.RightToLeft")));
338                         this.tb_timeout.ScrollBars = ((System.Windows.Forms.ScrollBars)(resources.GetObject("tb_timeout.ScrollBars")));
339                         this.tb_timeout.Size = ((System.Drawing.Size)(resources.GetObject("tb_timeout.Size")));
340                         this.tb_timeout.TabIndex = ((int)(resources.GetObject("tb_timeout.TabIndex")));
341                         this.tb_timeout.Text = resources.GetString("tb_timeout.Text");
342                         this.tb_timeout.TextAlign = ((System.Windows.Forms.HorizontalAlignment)(resources.GetObject("tb_timeout.TextAlign")));
343                         this.tb_timeout.Visible = ((bool)(resources.GetObject("tb_timeout.Visible")));
344                         this.tb_timeout.WordWrap = ((bool)(resources.GetObject("tb_timeout.WordWrap")));
345                         // 
346                         // lab_timeout
347                         // 
348                         this.lab_timeout.AccessibleDescription = ((string)(resources.GetObject("lab_timeout.AccessibleDescription")));
349                         this.lab_timeout.AccessibleName = ((string)(resources.GetObject("lab_timeout.AccessibleName")));
350                         this.lab_timeout.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("lab_timeout.Anchor")));
351                         this.lab_timeout.AutoSize = ((bool)(resources.GetObject("lab_timeout.AutoSize")));
352                         this.lab_timeout.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("lab_timeout.Dock")));
353                         this.lab_timeout.Enabled = ((bool)(resources.GetObject("lab_timeout.Enabled")));
354                         this.lab_timeout.Font = ((System.Drawing.Font)(resources.GetObject("lab_timeout.Font")));
355                         this.lab_timeout.Image = ((System.Drawing.Image)(resources.GetObject("lab_timeout.Image")));
356                         this.lab_timeout.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lab_timeout.ImageAlign")));
357                         this.lab_timeout.ImageIndex = ((int)(resources.GetObject("lab_timeout.ImageIndex")));
358                         this.lab_timeout.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("lab_timeout.ImeMode")));
359                         this.lab_timeout.Location = ((System.Drawing.Point)(resources.GetObject("lab_timeout.Location")));
360                         this.lab_timeout.Name = "lab_timeout";
361                         this.lab_timeout.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("lab_timeout.RightToLeft")));
362                         this.lab_timeout.Size = ((System.Drawing.Size)(resources.GetObject("lab_timeout.Size")));
363                         this.lab_timeout.TabIndex = ((int)(resources.GetObject("lab_timeout.TabIndex")));
364                         this.lab_timeout.Text = resources.GetString("lab_timeout.Text");
365                         this.lab_timeout.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lab_timeout.TextAlign")));
366                         this.lab_timeout.Visible = ((bool)(resources.GetObject("lab_timeout.Visible")));
367                         // 
368                         // cb_select_db
369                         // 
370                         this.cb_select_db.AccessibleDescription = ((string)(resources.GetObject("cb_select_db.AccessibleDescription")));
371                         this.cb_select_db.AccessibleName = ((string)(resources.GetObject("cb_select_db.AccessibleName")));
372                         this.cb_select_db.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("cb_select_db.Anchor")));
373                         this.cb_select_db.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("cb_select_db.BackgroundImage")));
374                         this.cb_select_db.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("cb_select_db.Dock")));
375                         this.cb_select_db.Enabled = ((bool)(resources.GetObject("cb_select_db.Enabled")));
376                         this.cb_select_db.Font = ((System.Drawing.Font)(resources.GetObject("cb_select_db.Font")));
377                         this.cb_select_db.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("cb_select_db.ImeMode")));
378                         this.cb_select_db.IntegralHeight = ((bool)(resources.GetObject("cb_select_db.IntegralHeight")));
379                         this.cb_select_db.ItemHeight = ((int)(resources.GetObject("cb_select_db.ItemHeight")));
380                         this.cb_select_db.Location = ((System.Drawing.Point)(resources.GetObject("cb_select_db.Location")));
381                         this.cb_select_db.MaxDropDownItems = ((int)(resources.GetObject("cb_select_db.MaxDropDownItems")));
382                         this.cb_select_db.MaxLength = ((int)(resources.GetObject("cb_select_db.MaxLength")));
383                         this.cb_select_db.Name = "cb_select_db";
384                         this.cb_select_db.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("cb_select_db.RightToLeft")));
385                         this.cb_select_db.Size = ((System.Drawing.Size)(resources.GetObject("cb_select_db.Size")));
386                         this.cb_select_db.TabIndex = ((int)(resources.GetObject("cb_select_db.TabIndex")));
387                         this.cb_select_db.Text = resources.GetString("cb_select_db.Text");
388                         this.cb_select_db.Visible = ((bool)(resources.GetObject("cb_select_db.Visible")));
389                         this.cb_select_db.DropDown += new System.EventHandler(this.cb_select_db_DropDown);
390                         // 
391                         // lab_select_db
392                         // 
393                         this.lab_select_db.AccessibleDescription = ((string)(resources.GetObject("lab_select_db.AccessibleDescription")));
394                         this.lab_select_db.AccessibleName = ((string)(resources.GetObject("lab_select_db.AccessibleName")));
395                         this.lab_select_db.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("lab_select_db.Anchor")));
396                         this.lab_select_db.AutoSize = ((bool)(resources.GetObject("lab_select_db.AutoSize")));
397                         this.lab_select_db.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("lab_select_db.Dock")));
398                         this.lab_select_db.Enabled = ((bool)(resources.GetObject("lab_select_db.Enabled")));
399                         this.lab_select_db.Font = ((System.Drawing.Font)(resources.GetObject("lab_select_db.Font")));
400                         this.lab_select_db.Image = ((System.Drawing.Image)(resources.GetObject("lab_select_db.Image")));
401                         this.lab_select_db.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lab_select_db.ImageAlign")));
402                         this.lab_select_db.ImageIndex = ((int)(resources.GetObject("lab_select_db.ImageIndex")));
403                         this.lab_select_db.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("lab_select_db.ImeMode")));
404                         this.lab_select_db.Location = ((System.Drawing.Point)(resources.GetObject("lab_select_db.Location")));
405                         this.lab_select_db.Name = "lab_select_db";
406                         this.lab_select_db.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("lab_select_db.RightToLeft")));
407                         this.lab_select_db.Size = ((System.Drawing.Size)(resources.GetObject("lab_select_db.Size")));
408                         this.lab_select_db.TabIndex = ((int)(resources.GetObject("lab_select_db.TabIndex")));
409                         this.lab_select_db.Text = resources.GetString("lab_select_db.Text");
410                         this.lab_select_db.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lab_select_db.TextAlign")));
411                         this.lab_select_db.Visible = ((bool)(resources.GetObject("lab_select_db.Visible")));
412                         // 
413                         // tb_password
414                         // 
415                         this.tb_password.AccessibleDescription = ((string)(resources.GetObject("tb_password.AccessibleDescription")));
416                         this.tb_password.AccessibleName = ((string)(resources.GetObject("tb_password.AccessibleName")));
417                         this.tb_password.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("tb_password.Anchor")));
418                         this.tb_password.AutoSize = ((bool)(resources.GetObject("tb_password.AutoSize")));
419                         this.tb_password.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("tb_password.BackgroundImage")));
420                         this.tb_password.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("tb_password.Dock")));
421                         this.tb_password.Enabled = ((bool)(resources.GetObject("tb_password.Enabled")));
422                         this.tb_password.Font = ((System.Drawing.Font)(resources.GetObject("tb_password.Font")));
423                         this.tb_password.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("tb_password.ImeMode")));
424                         this.tb_password.Location = ((System.Drawing.Point)(resources.GetObject("tb_password.Location")));
425                         this.tb_password.MaxLength = ((int)(resources.GetObject("tb_password.MaxLength")));
426                         this.tb_password.Multiline = ((bool)(resources.GetObject("tb_password.Multiline")));
427                         this.tb_password.Name = "tb_password";
428                         this.tb_password.PasswordChar = ((char)(resources.GetObject("tb_password.PasswordChar")));
429                         this.tb_password.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("tb_password.RightToLeft")));
430                         this.tb_password.ScrollBars = ((System.Windows.Forms.ScrollBars)(resources.GetObject("tb_password.ScrollBars")));
431                         this.tb_password.Size = ((System.Drawing.Size)(resources.GetObject("tb_password.Size")));
432                         this.tb_password.TabIndex = ((int)(resources.GetObject("tb_password.TabIndex")));
433                         this.tb_password.Text = resources.GetString("tb_password.Text");
434                         this.tb_password.TextAlign = ((System.Windows.Forms.HorizontalAlignment)(resources.GetObject("tb_password.TextAlign")));
435                         this.tb_password.Visible = ((bool)(resources.GetObject("tb_password.Visible")));
436                         this.tb_password.WordWrap = ((bool)(resources.GetObject("tb_password.WordWrap")));
437                         // 
438                         // lab_password
439                         // 
440                         this.lab_password.AccessibleDescription = ((string)(resources.GetObject("lab_password.AccessibleDescription")));
441                         this.lab_password.AccessibleName = ((string)(resources.GetObject("lab_password.AccessibleName")));
442                         this.lab_password.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("lab_password.Anchor")));
443                         this.lab_password.AutoSize = ((bool)(resources.GetObject("lab_password.AutoSize")));
444                         this.lab_password.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("lab_password.Dock")));
445                         this.lab_password.Enabled = ((bool)(resources.GetObject("lab_password.Enabled")));
446                         this.lab_password.Font = ((System.Drawing.Font)(resources.GetObject("lab_password.Font")));
447                         this.lab_password.Image = ((System.Drawing.Image)(resources.GetObject("lab_password.Image")));
448                         this.lab_password.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lab_password.ImageAlign")));
449                         this.lab_password.ImageIndex = ((int)(resources.GetObject("lab_password.ImageIndex")));
450                         this.lab_password.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("lab_password.ImeMode")));
451                         this.lab_password.Location = ((System.Drawing.Point)(resources.GetObject("lab_password.Location")));
452                         this.lab_password.Name = "lab_password";
453                         this.lab_password.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("lab_password.RightToLeft")));
454                         this.lab_password.Size = ((System.Drawing.Size)(resources.GetObject("lab_password.Size")));
455                         this.lab_password.TabIndex = ((int)(resources.GetObject("lab_password.TabIndex")));
456                         this.lab_password.Text = resources.GetString("lab_password.Text");
457                         this.lab_password.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lab_password.TextAlign")));
458                         this.lab_password.Visible = ((bool)(resources.GetObject("lab_password.Visible")));
459                         // 
460                         // tb_username
461                         // 
462                         this.tb_username.AccessibleDescription = ((string)(resources.GetObject("tb_username.AccessibleDescription")));
463                         this.tb_username.AccessibleName = ((string)(resources.GetObject("tb_username.AccessibleName")));
464                         this.tb_username.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("tb_username.Anchor")));
465                         this.tb_username.AutoSize = ((bool)(resources.GetObject("tb_username.AutoSize")));
466                         this.tb_username.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("tb_username.BackgroundImage")));
467                         this.tb_username.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("tb_username.Dock")));
468                         this.tb_username.Enabled = ((bool)(resources.GetObject("tb_username.Enabled")));
469                         this.tb_username.Font = ((System.Drawing.Font)(resources.GetObject("tb_username.Font")));
470                         this.tb_username.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("tb_username.ImeMode")));
471                         this.tb_username.Location = ((System.Drawing.Point)(resources.GetObject("tb_username.Location")));
472                         this.tb_username.MaxLength = ((int)(resources.GetObject("tb_username.MaxLength")));
473                         this.tb_username.Multiline = ((bool)(resources.GetObject("tb_username.Multiline")));
474                         this.tb_username.Name = "tb_username";
475                         this.tb_username.PasswordChar = ((char)(resources.GetObject("tb_username.PasswordChar")));
476                         this.tb_username.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("tb_username.RightToLeft")));
477                         this.tb_username.ScrollBars = ((System.Windows.Forms.ScrollBars)(resources.GetObject("tb_username.ScrollBars")));
478                         this.tb_username.Size = ((System.Drawing.Size)(resources.GetObject("tb_username.Size")));
479                         this.tb_username.TabIndex = ((int)(resources.GetObject("tb_username.TabIndex")));
480                         this.tb_username.Text = resources.GetString("tb_username.Text");
481                         this.tb_username.TextAlign = ((System.Windows.Forms.HorizontalAlignment)(resources.GetObject("tb_username.TextAlign")));
482                         this.tb_username.Visible = ((bool)(resources.GetObject("tb_username.Visible")));
483                         this.tb_username.WordWrap = ((bool)(resources.GetObject("tb_username.WordWrap")));
484                         // 
485                         // lab_username
486                         // 
487                         this.lab_username.AccessibleDescription = ((string)(resources.GetObject("lab_username.AccessibleDescription")));
488                         this.lab_username.AccessibleName = ((string)(resources.GetObject("lab_username.AccessibleName")));
489                         this.lab_username.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("lab_username.Anchor")));
490                         this.lab_username.AutoSize = ((bool)(resources.GetObject("lab_username.AutoSize")));
491                         this.lab_username.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("lab_username.Dock")));
492                         this.lab_username.Enabled = ((bool)(resources.GetObject("lab_username.Enabled")));
493                         this.lab_username.Font = ((System.Drawing.Font)(resources.GetObject("lab_username.Font")));
494                         this.lab_username.Image = ((System.Drawing.Image)(resources.GetObject("lab_username.Image")));
495                         this.lab_username.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lab_username.ImageAlign")));
496                         this.lab_username.ImageIndex = ((int)(resources.GetObject("lab_username.ImageIndex")));
497                         this.lab_username.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("lab_username.ImeMode")));
498                         this.lab_username.Location = ((System.Drawing.Point)(resources.GetObject("lab_username.Location")));
499                         this.lab_username.Name = "lab_username";
500                         this.lab_username.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("lab_username.RightToLeft")));
501                         this.lab_username.Size = ((System.Drawing.Size)(resources.GetObject("lab_username.Size")));
502                         this.lab_username.TabIndex = ((int)(resources.GetObject("lab_username.TabIndex")));
503                         this.lab_username.Text = resources.GetString("lab_username.Text");
504                         this.lab_username.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lab_username.TextAlign")));
505                         this.lab_username.Visible = ((bool)(resources.GetObject("lab_username.Visible")));
506                         // 
507                         // lab_login
508                         // 
509                         this.lab_login.AccessibleDescription = ((string)(resources.GetObject("lab_login.AccessibleDescription")));
510                         this.lab_login.AccessibleName = ((string)(resources.GetObject("lab_login.AccessibleName")));
511                         this.lab_login.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("lab_login.Anchor")));
512                         this.lab_login.AutoSize = ((bool)(resources.GetObject("lab_login.AutoSize")));
513                         this.lab_login.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("lab_login.Dock")));
514                         this.lab_login.Enabled = ((bool)(resources.GetObject("lab_login.Enabled")));
515                         this.lab_login.Font = ((System.Drawing.Font)(resources.GetObject("lab_login.Font")));
516                         this.lab_login.Image = ((System.Drawing.Image)(resources.GetObject("lab_login.Image")));
517                         this.lab_login.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lab_login.ImageAlign")));
518                         this.lab_login.ImageIndex = ((int)(resources.GetObject("lab_login.ImageIndex")));
519                         this.lab_login.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("lab_login.ImeMode")));
520                         this.lab_login.Location = ((System.Drawing.Point)(resources.GetObject("lab_login.Location")));
521                         this.lab_login.Name = "lab_login";
522                         this.lab_login.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("lab_login.RightToLeft")));
523                         this.lab_login.Size = ((System.Drawing.Size)(resources.GetObject("lab_login.Size")));
524                         this.lab_login.TabIndex = ((int)(resources.GetObject("lab_login.TabIndex")));
525                         this.lab_login.Text = resources.GetString("lab_login.Text");
526                         this.lab_login.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lab_login.TextAlign")));
527                         this.lab_login.Visible = ((bool)(resources.GetObject("lab_login.Visible")));
528                         // 
529                         // lab_server
530                         // 
531                         this.lab_server.AccessibleDescription = ((string)(resources.GetObject("lab_server.AccessibleDescription")));
532                         this.lab_server.AccessibleName = ((string)(resources.GetObject("lab_server.AccessibleName")));
533                         this.lab_server.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("lab_server.Anchor")));
534                         this.lab_server.AutoSize = ((bool)(resources.GetObject("lab_server.AutoSize")));
535                         this.lab_server.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("lab_server.Dock")));
536                         this.lab_server.Enabled = ((bool)(resources.GetObject("lab_server.Enabled")));
537                         this.lab_server.Font = ((System.Drawing.Font)(resources.GetObject("lab_server.Font")));
538                         this.lab_server.Image = ((System.Drawing.Image)(resources.GetObject("lab_server.Image")));
539                         this.lab_server.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lab_server.ImageAlign")));
540                         this.lab_server.ImageIndex = ((int)(resources.GetObject("lab_server.ImageIndex")));
541                         this.lab_server.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("lab_server.ImeMode")));
542                         this.lab_server.Location = ((System.Drawing.Point)(resources.GetObject("lab_server.Location")));
543                         this.lab_server.Name = "lab_server";
544                         this.lab_server.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("lab_server.RightToLeft")));
545                         this.lab_server.Size = ((System.Drawing.Size)(resources.GetObject("lab_server.Size")));
546                         this.lab_server.TabIndex = ((int)(resources.GetObject("lab_server.TabIndex")));
547                         this.lab_server.Text = resources.GetString("lab_server.Text");
548                         this.lab_server.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lab_server.TextAlign")));
549                         this.lab_server.Visible = ((bool)(resources.GetObject("lab_server.Visible")));
550                         // 
551                         // lab_advise
552                         // 
553                         this.lab_advise.AccessibleDescription = ((string)(resources.GetObject("lab_advise.AccessibleDescription")));
554                         this.lab_advise.AccessibleName = ((string)(resources.GetObject("lab_advise.AccessibleName")));
555                         this.lab_advise.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("lab_advise.Anchor")));
556                         this.lab_advise.AutoSize = ((bool)(resources.GetObject("lab_advise.AutoSize")));
557                         this.lab_advise.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("lab_advise.Dock")));
558                         this.lab_advise.Enabled = ((bool)(resources.GetObject("lab_advise.Enabled")));
559                         this.lab_advise.Font = ((System.Drawing.Font)(resources.GetObject("lab_advise.Font")));
560                         this.lab_advise.Image = ((System.Drawing.Image)(resources.GetObject("lab_advise.Image")));
561                         this.lab_advise.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lab_advise.ImageAlign")));
562                         this.lab_advise.ImageIndex = ((int)(resources.GetObject("lab_advise.ImageIndex")));
563                         this.lab_advise.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("lab_advise.ImeMode")));
564                         this.lab_advise.Location = ((System.Drawing.Point)(resources.GetObject("lab_advise.Location")));
565                         this.lab_advise.Name = "lab_advise";
566                         this.lab_advise.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("lab_advise.RightToLeft")));
567                         this.lab_advise.Size = ((System.Drawing.Size)(resources.GetObject("lab_advise.Size")));
568                         this.lab_advise.TabIndex = ((int)(resources.GetObject("lab_advise.TabIndex")));
569                         this.lab_advise.Text = resources.GetString("lab_advise.Text");
570                         this.lab_advise.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lab_advise.TextAlign")));
571                         this.lab_advise.Visible = ((bool)(resources.GetObject("lab_advise.Visible")));
572                         // 
573                         // btn_ok
574                         // 
575                         this.btn_ok.AccessibleDescription = ((string)(resources.GetObject("btn_ok.AccessibleDescription")));
576                         this.btn_ok.AccessibleName = ((string)(resources.GetObject("btn_ok.AccessibleName")));
577                         this.btn_ok.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("btn_ok.Anchor")));
578                         this.btn_ok.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btn_ok.BackgroundImage")));
579                         this.btn_ok.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("btn_ok.Dock")));
580                         this.btn_ok.Enabled = ((bool)(resources.GetObject("btn_ok.Enabled")));
581                         this.btn_ok.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("btn_ok.FlatStyle")));
582                         this.btn_ok.Font = ((System.Drawing.Font)(resources.GetObject("btn_ok.Font")));
583                         this.btn_ok.Image = ((System.Drawing.Image)(resources.GetObject("btn_ok.Image")));
584                         this.btn_ok.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btn_ok.ImageAlign")));
585                         this.btn_ok.ImageIndex = ((int)(resources.GetObject("btn_ok.ImageIndex")));
586                         this.btn_ok.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("btn_ok.ImeMode")));
587                         this.btn_ok.Location = ((System.Drawing.Point)(resources.GetObject("btn_ok.Location")));
588                         this.btn_ok.Name = "btn_ok";
589                         this.btn_ok.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("btn_ok.RightToLeft")));
590                         this.btn_ok.Size = ((System.Drawing.Size)(resources.GetObject("btn_ok.Size")));
591                         this.btn_ok.TabIndex = ((int)(resources.GetObject("btn_ok.TabIndex")));
592                         this.btn_ok.Text = resources.GetString("btn_ok.Text");
593                         this.btn_ok.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btn_ok.TextAlign")));
594                         this.btn_ok.Visible = ((bool)(resources.GetObject("btn_ok.Visible")));
595                         this.btn_ok.Click += new System.EventHandler(this.btn_ok_Click);
596                         // 
597                         // btn_cancel
598                         // 
599                         this.btn_cancel.AccessibleDescription = ((string)(resources.GetObject("btn_cancel.AccessibleDescription")));
600                         this.btn_cancel.AccessibleName = ((string)(resources.GetObject("btn_cancel.AccessibleName")));
601                         this.btn_cancel.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("btn_cancel.Anchor")));
602                         this.btn_cancel.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btn_cancel.BackgroundImage")));
603                         this.btn_cancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
604                         this.btn_cancel.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("btn_cancel.Dock")));
605                         this.btn_cancel.Enabled = ((bool)(resources.GetObject("btn_cancel.Enabled")));
606                         this.btn_cancel.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("btn_cancel.FlatStyle")));
607                         this.btn_cancel.Font = ((System.Drawing.Font)(resources.GetObject("btn_cancel.Font")));
608                         this.btn_cancel.Image = ((System.Drawing.Image)(resources.GetObject("btn_cancel.Image")));
609                         this.btn_cancel.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btn_cancel.ImageAlign")));
610                         this.btn_cancel.ImageIndex = ((int)(resources.GetObject("btn_cancel.ImageIndex")));
611                         this.btn_cancel.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("btn_cancel.ImeMode")));
612                         this.btn_cancel.Location = ((System.Drawing.Point)(resources.GetObject("btn_cancel.Location")));
613                         this.btn_cancel.Name = "btn_cancel";
614                         this.btn_cancel.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("btn_cancel.RightToLeft")));
615                         this.btn_cancel.Size = ((System.Drawing.Size)(resources.GetObject("btn_cancel.Size")));
616                         this.btn_cancel.TabIndex = ((int)(resources.GetObject("btn_cancel.TabIndex")));
617                         this.btn_cancel.Text = resources.GetString("btn_cancel.Text");
618                         this.btn_cancel.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btn_cancel.TextAlign")));
619                         this.btn_cancel.Visible = ((bool)(resources.GetObject("btn_cancel.Visible")));
620                         this.btn_cancel.Click += new System.EventHandler(this.btn_cancel_Click);
621                         // 
622                         // btn_help
623                         // 
624                         this.btn_help.AccessibleDescription = ((string)(resources.GetObject("btn_help.AccessibleDescription")));
625                         this.btn_help.AccessibleName = ((string)(resources.GetObject("btn_help.AccessibleName")));
626                         this.btn_help.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("btn_help.Anchor")));
627                         this.btn_help.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btn_help.BackgroundImage")));
628                         this.btn_help.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("btn_help.Dock")));
629                         this.btn_help.Enabled = ((bool)(resources.GetObject("btn_help.Enabled")));
630                         this.btn_help.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("btn_help.FlatStyle")));
631                         this.btn_help.Font = ((System.Drawing.Font)(resources.GetObject("btn_help.Font")));
632                         this.btn_help.Image = ((System.Drawing.Image)(resources.GetObject("btn_help.Image")));
633                         this.btn_help.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btn_help.ImageAlign")));
634                         this.btn_help.ImageIndex = ((int)(resources.GetObject("btn_help.ImageIndex")));
635                         this.btn_help.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("btn_help.ImeMode")));
636                         this.btn_help.Location = ((System.Drawing.Point)(resources.GetObject("btn_help.Location")));
637                         this.btn_help.Name = "btn_help";
638                         this.btn_help.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("btn_help.RightToLeft")));
639                         this.btn_help.Size = ((System.Drawing.Size)(resources.GetObject("btn_help.Size")));
640                         this.btn_help.TabIndex = ((int)(resources.GetObject("btn_help.TabIndex")));
641                         this.btn_help.Text = resources.GetString("btn_help.Text");
642                         this.btn_help.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btn_help.TextAlign")));
643                         this.btn_help.Visible = ((bool)(resources.GetObject("btn_help.Visible")));
644                         this.btn_help.Click += new System.EventHandler(this.btn_help_Click);
645                         // 
646                         // ConnectionStringEditorForm
647                         // 
648                         this.AcceptButton = this.btn_ok;
649                         this.AccessibleDescription = ((string)(resources.GetObject("$this.AccessibleDescription")));
650                         this.AccessibleName = ((string)(resources.GetObject("$this.AccessibleName")));
651                         this.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("$this.Anchor")));
652                         this.AutoScaleBaseSize = ((System.Drawing.Size)(resources.GetObject("$this.AutoScaleBaseSize")));
653                         this.AutoScroll = ((bool)(resources.GetObject("$this.AutoScroll")));
654                         this.AutoScrollMargin = ((System.Drawing.Size)(resources.GetObject("$this.AutoScrollMargin")));
655                         this.AutoScrollMinSize = ((System.Drawing.Size)(resources.GetObject("$this.AutoScrollMinSize")));
656                         this.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("$this.BackgroundImage")));
657                         this.CancelButton = this.btn_cancel;
658                         this.ClientSize = ((System.Drawing.Size)(resources.GetObject("$this.ClientSize")));
659                         this.Controls.AddRange(new System.Windows.Forms.Control[] {
660                                                                                                                                                                                                                                                                         this.btn_help,
661                                                                                                                                                                                                                                                                         this.btn_cancel,
662                                                                                                                                                                                                                                                                         this.btn_ok,
663                                                                                                                                                                                                                                                                         this.tc_main});
664                         this.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("$this.Dock")));
665                         this.Enabled = ((bool)(resources.GetObject("$this.Enabled")));
666                         this.Font = ((System.Drawing.Font)(resources.GetObject("$this.Font")));
667                         this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
668                         this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
669                         this.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("$this.ImeMode")));
670                         this.Location = ((System.Drawing.Point)(resources.GetObject("$this.Location")));
671                         this.MaximizeBox = false;
672                         this.MaximumSize = ((System.Drawing.Size)(resources.GetObject("$this.MaximumSize")));
673                         this.MinimizeBox = false;
674                         this.MinimumSize = ((System.Drawing.Size)(resources.GetObject("$this.MinimumSize")));
675                         this.Name = "ConnectionStringEditorForm";
676                         this.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("$this.RightToLeft")));
677                         this.ShowInTaskbar = false;
678                         this.StartPosition = ((System.Windows.Forms.FormStartPosition)(resources.GetObject("$this.StartPosition")));
679                         this.Text = resources.GetString("$this.Text");
680                         this.Visible = ((bool)(resources.GetObject("$this.Visible")));
681                         this.tc_main.ResumeLayout(false);
682                         this.tp_connection.ResumeLayout(false);
683                         this.gb_add_parms.ResumeLayout(false);
684                         this.ResumeLayout(false);
685
686                 }
687                 #endregion
688
689                 private void btn_cancel_Click(object sender, System.EventArgs e) {
690                         this.DialogResult = DialogResult.Cancel;
691                         this.Close();
692                 }
693
694                 private void btn_ok_Click(object sender, System.EventArgs e) {
695                         if(connect(false) == true){
696                                 this.DialogResult = DialogResult.OK;
697                                 this.Close();
698                         }
699                 }
700
701                 private void btn_help_Click(object sender, System.EventArgs e) {
702                 
703                 }
704
705                 private void btn_check_connection_Click(object sender, System.EventArgs e) {
706                         if(connect(false) == true){
707                                 MessageBox.Show(this, resman.GetString("MsgboxText_Success"), resman.GetString("MsgboxTitle_Success"), MessageBoxButtons.OK, MessageBoxIcon.None);
708                         }
709                 }
710
711                 /// <summary>
712                 /// Returns the generated ConnectionString
713                 /// </summary>
714                 public string ConnectionString {
715                         get {
716                                 return this.pgconn.ConnectionString;
717                         }
718                 }
719
720                 private bool connect(bool fillComboBox) {
721                         try{
722                                 StringWriter sw = new StringWriter();
723                                 if(this.tb_server.Text == String.Empty){
724                                         MessageBox.Show(this, resman.GetString("MsgboxText_NoServer"), resman.GetString("MsgboxTitle_Error"), MessageBoxButtons.OK, MessageBoxIcon.Error);
725                                         return false;
726                                 }
727                                 if(this.tb_username.Text == String.Empty){
728                                         MessageBox.Show(this, resman.GetString("MsgboxText_NoUser"), resman.GetString("MsgboxTitle_Error"), MessageBoxButtons.OK, MessageBoxIcon.Error);
729                                         return false;
730                                 }
731                                 if(this.tb_port.Text == String.Empty){
732                                         sw.Write("Port=5432;");
733                                 }else{
734                                         sw.Write("Port={0};", tb_port.Text);
735                                 }
736                                 // this happens if the user clicks Ok or Check Connection
737                                 // before selecting a database
738                                 if(fillComboBox == false && (String)this.cb_select_db.Text == String.Empty){
739                                         MessageBox.Show(this, resman.GetString("MsgboxText_NoDb"), resman.GetString("MsgboxTitle_Error"), MessageBoxButtons.OK, MessageBoxIcon.Error);
740                                         return false;
741                                 }
742                                         // this happens if the user clicks the database-combobox
743                                         // in order to select a database
744                                 else if(fillComboBox == true && (String)this.cb_select_db.Text == String.Empty){
745                                         sw.Write("Database=template1;");
746                                 }
747                                 else{
748                                         sw.Write("Database={0};", this.cb_select_db.Text);
749                                 }
750                                 try{
751                                         if(this.tb_timeout.Text == String.Empty){}
752                                         else if(Int32.Parse(this.tb_timeout.Text) > 0){
753                                                 sw.Write("Connect Timeout={0};", this.tb_timeout.Text);
754                                         }
755                                 }
756                                         // don't mind if the value is nonsense - just don't put it into the string
757                                 catch(FormatException){
758                                         MessageBox.Show(this, resman.GetString("MsgboxText_TimeoutNaN"), resman.GetString("MsgboxTitle_Error"), MessageBoxButtons.OK, MessageBoxIcon.Error);
759                                         return false;
760                                 }
761                                 catch(OverflowException){
762                                         MessageBox.Show(this, resman.GetString("MsgboxText_TimeoutOverflow"), resman.GetString("MsgboxTitle_Error"), MessageBoxButtons.OK, MessageBoxIcon.Error);
763                                         return false;
764                                 }
765
766                                 sw.Write("Server={0};User Id={1};Password={2};", this.tb_server.Text, this.tb_username.Text, this.tb_password.Text);
767                                 this.pgconn.ConnectionString = sw.ToString();
768                                 this.pgconn.Open();
769                                 if(fillComboBox == true){
770                                         cb_select_db.Items.Clear();
771                                         NpgsqlCommand com = new NpgsqlCommand("SELECT datname FROM pg_database WHERE datallowconn = 't'", this.pgconn);
772                                         NpgsqlDataReader dr = com.ExecuteReader();
773                                         while(dr.Read()){
774                                                 cb_select_db.Items.Add(dr["datname"]);
775                                                 if(cb_select_db.Items.Count > 0){
776                                                         cb_select_db.SelectedIndex = 0;
777                                                 }
778                                         }
779                                 }
780                                 this.pgconn.Close();
781                         }catch(Exception ex){
782                                 MessageBox.Show(this, ex.Message, resman.GetString("MsgboxTitle_Error"), MessageBoxButtons.OK, MessageBoxIcon.Error);
783                                 return false;
784                         }
785                         return true;
786                 }
787
788                 private void btn_refresh_Click(object sender, System.EventArgs e) {
789                         connect(true);
790                 }
791
792
793
794                 private void cb_select_db_DropDown(object sender, System.EventArgs e) {
795
796                         if(cb_select_db.Items.Count < 1){
797                                 connect(true);
798                         }
799                 }
800         }
801 }