Datei: NDOPackage/RelationDialog.cs

Last Commit (33e9857)
1 //
2 // Copyright (c) 2002-2022 Mirko Matytschak
3 // (www.netdataobjects.de)
4 //
5 // Author: Mirko Matytschak
6 //
7 // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
8 // documentation files (the "Software"), to deal in the Software without restriction, including without limitation
9 // the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
10 // Software, and to permit persons to whom the Software is furnished to do so, subject to the following
11 // conditions:
12
13 // The above copyright notice and this permission notice shall be included in all copies or substantial portions
14 // of the Software.
15 //
16 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
17 // TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
19 // CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 // DEALINGS IN THE SOFTWARE.
21
22
23 using System;
24 using System.Drawing;
25 using System.Collections;
26 using System.ComponentModel;
27 using System.Windows.Forms;
28
29 namespace NDOVsPackage
30 {
31 ····internal enum ListType
32 ····{
33 ········IList,
34 ········ArrayList
35 ····}
36
37 ····/// <summary>
38 ····/// Zusammenfassung für RelationDialog.
39 ····/// </summary>
40 ····internal class RelationDialog : System.Windows.Forms.Form
41 ····{
42 ········private System.Windows.Forms.TextBox txtFieldName;
43 ········private System.Windows.Forms.Label label1;
44 ········private System.Windows.Forms.GroupBox groupBox1;
45 ········private System.Windows.Forms.RadioButton radioSingle;
46 ········private System.Windows.Forms.RadioButton radioList;
47 ········private System.Windows.Forms.GroupBox groupBox2;
48 ········private System.Windows.Forms.RadioButton radioComposite;
49 ········private System.Windows.Forms.RadioButton radioAggregate;
50 ········private System.Windows.Forms.Button btnOK;
51 ········private System.Windows.Forms.Button btnCancel;
52 ········private System.Windows.Forms.TextBox txtElementType;
53 ········private System.Windows.Forms.Label label2;
54 ········private System.Windows.Forms.ToolTip toolTip1;
55 ········private System.Windows.Forms.TextBox txtRoleName;
56 ········private System.Windows.Forms.Label label3;
57 ········private System.Windows.Forms.GroupBox groupBox3;
58 ········private System.Windows.Forms.RadioButton radioArrayList;
59 ········private System.Windows.Forms.RadioButton radioIList;
60 ········private System.Windows.Forms.CheckBox chkUseGenerics;
61 ········private System.ComponentModel.IContainer components;
62
63 ········public RelationDialog()
64 ········{
65 ············//
66 ············// Erforderlich für die Windows Form-Designerunterstützung
67 ············//
68 ············InitializeComponent();
69 ············this.chkUseGenerics.Checked = true;
70 ········}
71
72 ········public string FieldName
73 ········{
74 ············get { return this.txtFieldName.Text; }
75 ········}
76
77 ········public string Type
78 ········{
79 ············get { return this.txtElementType.Text; }
80 ········}
81
82 ········public bool Composite
83 ········{
84 ············get { return this.radioComposite.Checked; }
85 ········}
86
87 ········public bool List
88 ········{
89 ············get { return this.radioList.Checked; }
90 ········}
91
92 ········public string RelationName
93 ········{
94 ············get { return this.txtRoleName.Text; }
95 ········}
96
97 ········public ListType ListType
98 ········{
99 ············get
100 ············{
101 ················if (radioIList.Checked)
102 ····················return ListType.IList;
103 ················return ListType.ArrayList;
104 ············}
105 ········}
106
107 ········public bool UseGenerics
108 ········{
109 ············get { return this.chkUseGenerics.Checked; }
110 ········}
111
112
113 ········/// <summary>
114 ········/// Die verwendeten Ressourcen bereinigen.
115 ········/// </summary>
116 ········protected override void Dispose( bool disposing )
117 ········{
118 ············if( disposing )
119 ············{
120 ················if(components != null)
121 ················{
122 ····················components.Dispose();
123 ················}
124 ············}
125 ············base.Dispose( disposing );
126 ········}
127
128 ········#region Vom Windows Form-Designer generierter Code
129 ········/// <summary>
130 ········/// Erforderliche Methode für die Designerunterstützung.
131 ········/// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden.
132 ········/// </summary>
133 ········private void InitializeComponent()
134 ········{
135 ············this.components = new System.ComponentModel.Container();
136 ············System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(RelationDialog));
137 ············this.txtFieldName = new System.Windows.Forms.TextBox();
138 ············this.label1 = new System.Windows.Forms.Label();
139 ············this.groupBox1 = new System.Windows.Forms.GroupBox();
140 ············this.radioList = new System.Windows.Forms.RadioButton();
141 ············this.radioSingle = new System.Windows.Forms.RadioButton();
142 ············this.groupBox2 = new System.Windows.Forms.GroupBox();
143 ············this.radioAggregate = new System.Windows.Forms.RadioButton();
144 ············this.radioComposite = new System.Windows.Forms.RadioButton();
145 ············this.btnOK = new System.Windows.Forms.Button();
146 ············this.btnCancel = new System.Windows.Forms.Button();
147 ············this.txtElementType = new System.Windows.Forms.TextBox();
148 ············this.label2 = new System.Windows.Forms.Label();
149 ············this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
150 ············this.txtRoleName = new System.Windows.Forms.TextBox();
151 ············this.radioArrayList = new System.Windows.Forms.RadioButton();
152 ············this.radioIList = new System.Windows.Forms.RadioButton();
153 ············this.label3 = new System.Windows.Forms.Label();
154 ············this.groupBox3 = new System.Windows.Forms.GroupBox();
155 ············this.chkUseGenerics = new System.Windows.Forms.CheckBox();
156 ············this.groupBox1.SuspendLayout();
157 ············this.groupBox2.SuspendLayout();
158 ············this.groupBox3.SuspendLayout();
159 ············this.SuspendLayout();
160 ············//
161 ············// txtFieldName
162 ············//
163 ············this.txtFieldName.Location = new System.Drawing.Point(137, 59);
164 ············this.txtFieldName.Name = "txtFieldName";
165 ············this.txtFieldName.Size = new System.Drawing.Size(267, 20);
166 ············this.txtFieldName.TabIndex = 1;
167 ············this.toolTip1.SetToolTip(this.txtFieldName, "Name of the variable in which the relation is stored");
168 ············this.txtFieldName.TextChanged += new System.EventHandler(this.txtFieldName_TextChanged);
169 ············//
170 ············// label1
171 ············//
172 ············this.label1.Location = new System.Drawing.Point(44, 59);
173 ············this.label1.Name = "label1";
174 ············this.label1.Size = new System.Drawing.Size(80, 20);
175 ············this.label1.TabIndex = 15;
176 ············this.label1.Text = "Field Name";
177 ············//
178 ············// groupBox1
179 ············//
180 ············this.groupBox1.Controls.Add(this.radioList);
181 ············this.groupBox1.Controls.Add(this.radioSingle);
182 ············this.groupBox1.Location = new System.Drawing.Point(230, 128);
183 ············this.groupBox1.Name = "groupBox1";
184 ············this.groupBox1.Size = new System.Drawing.Size(174, 90);
185 ············this.groupBox1.TabIndex = 4;
186 ············this.groupBox1.TabStop = false;
187 ············this.groupBox1.Text = " Multiplicity ";
188 ············//
189 ············// radioList
190 ············//
191 ············this.radioList.Checked = true;
192 ············this.radioList.Location = new System.Drawing.Point(37, 60);
193 ············this.radioList.Name = "radioList";
194 ············this.radioList.Size = new System.Drawing.Size(120, 28);
195 ············this.radioList.TabIndex = 1;
196 ············this.radioList.TabStop = true;
197 ············this.radioList.Text = "List";
198 ············this.toolTip1.SetToolTip(this.radioList, "Relation to a list of objects");
199 ············//
200 ············// radioSingle
201 ············//
202 ············this.radioSingle.Location = new System.Drawing.Point(37, 35);
203 ············this.radioSingle.Name = "radioSingle";
204 ············this.radioSingle.Size = new System.Drawing.Size(120, 21);
205 ············this.radioSingle.TabIndex = 0;
206 ············this.radioSingle.Text = "Single Element";
207 ············this.toolTip1.SetToolTip(this.radioSingle, "Relation to one single object");
208 ············this.radioSingle.CheckedChanged += new System.EventHandler(this.radioSingle_CheckedChanged);
209 ············//
210 ············// groupBox2
211 ············//
212 ············this.groupBox2.Controls.Add(this.radioAggregate);
213 ············this.groupBox2.Controls.Add(this.radioComposite);
214 ············this.groupBox2.Location = new System.Drawing.Point(44, 128);
215 ············this.groupBox2.Name = "groupBox2";
216 ············this.groupBox2.Size = new System.Drawing.Size(173, 90);
217 ············this.groupBox2.TabIndex = 3;
218 ············this.groupBox2.TabStop = false;
219 ············this.groupBox2.Text = " Relation Type··";
220 ············//
221 ············// radioAggregate
222 ············//
223 ············this.radioAggregate.Location = new System.Drawing.Point(30, 60);
224 ············this.radioAggregate.Name = "radioAggregate";
225 ············this.radioAggregate.Size = new System.Drawing.Size(127, 21);
226 ············this.radioAggregate.TabIndex = 1;
227 ············this.radioAggregate.Text = "Assoziation";
228 ············this.toolTip1.SetToolTip(this.radioAggregate, "Relation contains independent objects with own life-cycles");
229 ············//
230 ············// radioComposite
231 ············//
232 ············this.radioComposite.Checked = true;
233 ············this.radioComposite.Location = new System.Drawing.Point(30, 35);
234 ············this.radioComposite.Name = "radioComposite";
235 ············this.radioComposite.Size = new System.Drawing.Size(127, 21);
236 ············this.radioComposite.TabIndex = 0;
237 ············this.radioComposite.TabStop = true;
238 ············this.radioComposite.Text = "Composition";
239 ············this.toolTip1.SetToolTip(this.radioComposite, "Life-cycle of the related objects are coupled to the lifetime of the owner");
240 ············//
241 ············// btnOK
242 ············//
243 ············this.btnOK.DialogResult = System.Windows.Forms.DialogResult.OK;
244 ············this.btnOK.Enabled = false;
245 ············this.btnOK.Location = new System.Drawing.Point(297, 343);
246 ············this.btnOK.Name = "btnOK";
247 ············this.btnOK.Size = new System.Drawing.Size(107, 28);
248 ············this.btnOK.TabIndex = 7;
249 ············this.btnOK.Text = "OK";
250 ············//
251 ············// btnCancel
252 ············//
253 ············this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
254 ············this.btnCancel.Location = new System.Drawing.Point(177, 343);
255 ············this.btnCancel.Name = "btnCancel";
256 ············this.btnCancel.Size = new System.Drawing.Size(107, 28);
257 ············this.btnCancel.TabIndex = 6;
258 ············this.btnCancel.Text = "Cancel";
259 ············//
260 ············// txtElementType
261 ············//
262 ············this.txtElementType.Location = new System.Drawing.Point(137, 24);
263 ············this.txtElementType.Name = "txtElementType";
264 ············this.txtElementType.Size = new System.Drawing.Size(267, 20);
265 ············this.txtElementType.TabIndex = 0;
266 ············this.toolTip1.SetToolTip(this.txtElementType, "Type of the related objects");
267 ············this.txtElementType.TextChanged += new System.EventHandler(this.txtElementType_TextChanged);
268 ············//
269 ············// label2
270 ············//
271 ············this.label2.Location = new System.Drawing.Point(44, 24);
272 ············this.label2.Name = "label2";
273 ············this.label2.Size = new System.Drawing.Size(80, 21);
274 ············this.label2.TabIndex = 8;
275 ············this.label2.Text = "Element Type";
276 ············//
277 ············// txtRoleName
278 ············//
279 ············this.txtRoleName.Location = new System.Drawing.Point(137, 93);
280 ············this.txtRoleName.Name = "txtRoleName";
281 ············this.txtRoleName.Size = new System.Drawing.Size(267, 20);
282 ············this.txtRoleName.TabIndex = 2;
283 ············this.toolTip1.SetToolTip(this.txtRoleName, "Name of the variable in which the relation is stored");
284 ············//
285 ············// radioArrayList
286 ············//
287 ············this.radioArrayList.Checked = true;
288 ············this.radioArrayList.Location = new System.Drawing.Point(30, 60);
289 ············this.radioArrayList.Name = "radioArrayList";
290 ············this.radioArrayList.Size = new System.Drawing.Size(127, 21);
291 ············this.radioArrayList.TabIndex = 1;
292 ············this.radioArrayList.TabStop = true;
293 ············this.radioArrayList.Text = "List<T>";
294 ············this.toolTip1.SetToolTip(this.radioArrayList, "Relation contains independent objects with own life-cycles");
295 ············//
296 ············// radioIList
297 ············//
298 ············this.radioIList.Location = new System.Drawing.Point(30, 35);
299 ············this.radioIList.Name = "radioIList";
300 ············this.radioIList.Size = new System.Drawing.Size(127, 21);
301 ············this.radioIList.TabIndex = 0;
302 ············this.radioIList.Text = "IList<T>";
303 ············this.toolTip1.SetToolTip(this.radioIList, "Life-cycle of the related objects are coupled to the lifetime of the owner");
304 ············//
305 ············// label3
306 ············//
307 ············this.label3.Location = new System.Drawing.Point(43, 91);
308 ············this.label3.Name = "label3";
309 ············this.label3.Size = new System.Drawing.Size(86, 28);
310 ············this.label3.TabIndex = 15;
311 ············this.label3.Text = "Optional Role Name";
312 ············//
313 ············// groupBox3
314 ············//
315 ············this.groupBox3.Controls.Add(this.chkUseGenerics);
316 ············this.groupBox3.Controls.Add(this.radioArrayList);
317 ············this.groupBox3.Controls.Add(this.radioIList);
318 ············this.groupBox3.Location = new System.Drawing.Point(44, 225);
319 ············this.groupBox3.Name = "groupBox3";
320 ············this.groupBox3.Size = new System.Drawing.Size(360, 91);
321 ············this.groupBox3.TabIndex = 5;
322 ············this.groupBox3.TabStop = false;
323 ············this.groupBox3.Text = " Coding Style··";
324 ············//
325 ············// chkUseGenerics
326 ············//
327 ············this.chkUseGenerics.Checked = true;
328 ············this.chkUseGenerics.CheckState = System.Windows.Forms.CheckState.Checked;
329 ············this.chkUseGenerics.Location = new System.Drawing.Point(204, 35);
330 ············this.chkUseGenerics.Name = "chkUseGenerics";
331 ············this.chkUseGenerics.Size = new System.Drawing.Size(160, 21);
332 ············this.chkUseGenerics.TabIndex = 3;
333 ············this.chkUseGenerics.Text = "Use Generics";
334 ············this.chkUseGenerics.CheckedChanged += new System.EventHandler(this.chkUseGenerics_CheckedChanged);
335 ············//
336 ············// RelationDialog
337 ············//
338 ············this.AcceptButton = this.btnOK;
339 ············this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
340 ············this.CancelButton = this.btnCancel;
341 ············this.ClientSize = new System.Drawing.Size(448, 403);
342 ············this.Controls.Add(this.groupBox3);
343 ············this.Controls.Add(this.txtRoleName);
344 ············this.Controls.Add(this.label3);
345 ············this.Controls.Add(this.label2);
346 ············this.Controls.Add(this.txtElementType);
347 ············this.Controls.Add(this.txtFieldName);
348 ············this.Controls.Add(this.btnCancel);
349 ············this.Controls.Add(this.btnOK);
350 ············this.Controls.Add(this.groupBox2);
351 ············this.Controls.Add(this.groupBox1);
352 ············this.Controls.Add(this.label1);
353 ············this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
354 ············this.Name = "RelationDialog";
355 ············this.Text = "Add Relation";
356 ············this.groupBox1.ResumeLayout(false);
357 ············this.groupBox2.ResumeLayout(false);
358 ············this.groupBox3.ResumeLayout(false);
359 ············this.ResumeLayout(false);
360 ············this.PerformLayout();
361
362 ········}
363 ········#endregion
364
365 ········private void txtElementType_TextChanged(object sender, System.EventArgs e)
366 ········{
367 ············this.btnOK.Enabled = (txtElementType.Text.Trim() != "" && txtFieldName.Text.Trim() != "");
368 ········}
369
370 ········private void txtFieldName_TextChanged(object sender, System.EventArgs e)
371 ········{
372 ············this.btnOK.Enabled = (txtElementType.Text.Trim() != "" && txtFieldName.Text.Trim() != "");
373 ········}
374
375 ········private void radioSingle_CheckedChanged(object sender, System.EventArgs e)
376 ········{
377 ············this.chkUseGenerics.Enabled =
378 ················this.radioArrayList.Enabled =
379 ················this.radioIList.Enabled = !radioSingle.Checked;
380 ········}
381
382 ········private void chkUseGenerics_CheckedChanged(object sender, EventArgs e)
383 ········{
384 ············if (chkUseGenerics.Checked)
385 ············{
386 ················radioArrayList.Text = "List<T>";
387 ················radioIList.Text = "IList<T>";
388 ············}
389 ············else
390 ············{
391 ················radioArrayList.Text = "ArrayList";
392 ················radioArrayList.Checked = true;
393 ················radioIList.Text = "IList";
394 ············}
395 ········}
396 ····}
397 }
398 ···· }
399 ····}
400 }
401
New Commit (aa458ff)
1 //
2 // Copyright (c) 2002-2022 Mirko Matytschak
3 // (www.netdataobjects.de)
4 //
5 // Author: Mirko Matytschak
6 //
7 // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
8 // documentation files (the "Software"), to deal in the Software without restriction, including without limitation
9 // the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
10 // Software, and to permit persons to whom the Software is furnished to do so, subject to the following
11 // conditions:
12
13 // The above copyright notice and this permission notice shall be included in all copies or substantial portions
14 // of the Software.
15 //
16 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
17 // TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
19 // CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 // DEALINGS IN THE SOFTWARE.
21
22
23 using System;
24 using System.Drawing;
25 using System.Collections;
26 using System.ComponentModel;
27 using System.Windows.Forms;
28
29 namespace NDOVsPackage
30 {
31 ····internal enum ListType
32 ····{
33 ········IList,
34 ········ArrayList
35 ····}
36
37 ····/// <summary>
38 ····/// Zusammenfassung für RelationDialog.
39 ····/// </summary>
40 ····internal class RelationDialog : System.Windows.Forms.Form
41 ····{
42 ········private System.Windows.Forms.TextBox txtFieldName;
43 ········private System.Windows.Forms.Label label1;
44 ········private System.Windows.Forms.GroupBox groupBox1;
45 ········private System.Windows.Forms.RadioButton radioSingle;
46 ········private System.Windows.Forms.RadioButton radioList;
47 ········private System.Windows.Forms.GroupBox groupBox2;
48 ········private System.Windows.Forms.RadioButton radioComposite;
49 ········private System.Windows.Forms.RadioButton radioAggregate;
50 ········private System.Windows.Forms.Button btnOK;
51 ········private System.Windows.Forms.Button btnCancel;
52 ········private System.Windows.Forms.TextBox txtElementType;
53 ········private System.Windows.Forms.Label label2;
54 ········private System.Windows.Forms.ToolTip toolTip1;
55 ········private System.Windows.Forms.TextBox txtRoleName;
56 ········private System.Windows.Forms.Label label3;
57 ········private System.Windows.Forms.GroupBox groupBox3;
58 ········private System.Windows.Forms.RadioButton radioArrayList;
59 ········private System.Windows.Forms.RadioButton radioIList;
60 ········private System.Windows.Forms.CheckBox chkUseGenerics;
61 ········private System.ComponentModel.IContainer components;
62
63 ········public RelationDialog()
64 ········{
65 ············//
66 ············// Erforderlich für die Windows Form-Designerunterstützung
67 ············//
68 ············InitializeComponent();
69 ············this.chkUseGenerics.Checked = true;
70 ········}
71
72 ········public string FieldName
73 ········{
74 ············get { return this.txtFieldName.Text; }
75 ········}
76
77 ········public string Type
78 ········{
79 ············get { return this.txtElementType.Text; }
80 ········}
81
82 ········public bool Composite
83 ········{
84 ············get { return this.radioComposite.Checked; }
85 ········}
86
87 ········public bool List
88 ········{
89 ············get { return this.radioList.Checked; }
90 ········}
91
92 ········public string RelationName
93 ········{
94 ············get { return this.txtRoleName.Text; }
95 ········}
96
97 ········public ListType ListType
98 ········{
99 ············get
100 ············{
101 ················if (radioIList.Checked)
102 ····················return ListType.IList;
103 ················return ListType.ArrayList;
104 ············}
105 ········}
106
107 ········public bool UseGenerics
108 ········{
109 ············get { return this.chkUseGenerics.Checked; }
110 ········}
111
112
113 ········/// <summary>
114 ········/// Die verwendeten Ressourcen bereinigen.
115 ········/// </summary>
116 ········protected override void Dispose( bool disposing )
117 ········{
118 ············if( disposing )
119 ············{
120 ················if(components != null)
121 ················{
122 ····················components.Dispose();
123 ················}
124 ············}
125 ············base.Dispose( disposing );
126 ········}
127
128 ········#region Vom Windows Form-Designer generierter Code
129 ········/// <summary>
130 ········/// Erforderliche Methode für die Designerunterstützung.
131 ········/// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden.
132 ········/// </summary>
133 ········private void InitializeComponent()
134 ········{
135 ············this.components = new System.ComponentModel.Container();
136 ············System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(RelationDialog));
137 ············this.txtFieldName = new System.Windows.Forms.TextBox();
138 ············this.label1 = new System.Windows.Forms.Label();
139 ············this.groupBox1 = new System.Windows.Forms.GroupBox();
140 ············this.radioList = new System.Windows.Forms.RadioButton();
141 ············this.radioSingle = new System.Windows.Forms.RadioButton();
142 ············this.groupBox2 = new System.Windows.Forms.GroupBox();
143 ············this.radioAggregate = new System.Windows.Forms.RadioButton();
144 ············this.radioComposite = new System.Windows.Forms.RadioButton();
145 ············this.btnOK = new System.Windows.Forms.Button();
146 ············this.btnCancel = new System.Windows.Forms.Button();
147 ············this.txtElementType = new System.Windows.Forms.TextBox();
148 ············this.label2 = new System.Windows.Forms.Label();
149 ············this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
150 ············this.txtRoleName = new System.Windows.Forms.TextBox();
151 ············this.radioArrayList = new System.Windows.Forms.RadioButton();
152 ············this.radioIList = new System.Windows.Forms.RadioButton();
153 ············this.label3 = new System.Windows.Forms.Label();
154 ············this.groupBox3 = new System.Windows.Forms.GroupBox();
155 ············this.chkUseGenerics = new System.Windows.Forms.CheckBox();
156 ············this.groupBox1.SuspendLayout();
157 ············this.groupBox2.SuspendLayout();
158 ············this.groupBox3.SuspendLayout();
159 ············this.SuspendLayout();
160 ············//
161 ············// txtFieldName
162 ············//
163 ············this.txtFieldName.Location = new System.Drawing.Point(137, 59);
164 ············this.txtFieldName.Name = "txtFieldName";
165 ············this.txtFieldName.Size = new System.Drawing.Size(267, 20);
166 ············this.txtFieldName.TabIndex = 1;
167 ············this.toolTip1.SetToolTip(this.txtFieldName, "Name of the variable in which the relation is stored");
168 ············this.txtFieldName.TextChanged += new System.EventHandler(this.txtFieldName_TextChanged);
169 ············//
170 ············// label1
171 ············//
172 ············this.label1.Location = new System.Drawing.Point(44, 59);
173 ············this.label1.Name = "label1";
174 ············this.label1.Size = new System.Drawing.Size(80, 20);
175 ············this.label1.TabIndex = 15;
176 ············this.label1.Text = "Field Name";
177 ············//
178 ············// groupBox1
179 ············//
180 ············this.groupBox1.Controls.Add(this.radioList);
181 ············this.groupBox1.Controls.Add(this.radioSingle);
182 ············this.groupBox1.Location = new System.Drawing.Point(230, 128);
183 ············this.groupBox1.Name = "groupBox1";
184 ············this.groupBox1.Size = new System.Drawing.Size(174, 90);
185 ············this.groupBox1.TabIndex = 4;
186 ············this.groupBox1.TabStop = false;
187 ············this.groupBox1.Text = " Multiplicity ";
188 ············//
189 ············// radioList
190 ············//
191 ············this.radioList.Checked = true;
192 ············this.radioList.Location = new System.Drawing.Point(37, 60);
193 ············this.radioList.Name = "radioList";
194 ············this.radioList.Size = new System.Drawing.Size(120, 28);
195 ············this.radioList.TabIndex = 1;
196 ············this.radioList.TabStop = true;
197 ············this.radioList.Text = "List";
198 ············this.toolTip1.SetToolTip(this.radioList, "Relation to a list of objects");
199 ············//
200 ············// radioSingle
201 ············//
202 ············this.radioSingle.Location = new System.Drawing.Point(37, 35);
203 ············this.radioSingle.Name = "radioSingle";
204 ············this.radioSingle.Size = new System.Drawing.Size(120, 21);
205 ············this.radioSingle.TabIndex = 0;
206 ············this.radioSingle.Text = "Single Element";
207 ············this.toolTip1.SetToolTip(this.radioSingle, "Relation to one single object");
208 ············this.radioSingle.CheckedChanged += new System.EventHandler(this.radioSingle_CheckedChanged);
209 ············//
210 ············// groupBox2
211 ············//
212 ············this.groupBox2.Controls.Add(this.radioAggregate);
213 ············this.groupBox2.Controls.Add(this.radioComposite);
214 ············this.groupBox2.Location = new System.Drawing.Point(44, 128);
215 ············this.groupBox2.Name = "groupBox2";
216 ············this.groupBox2.Size = new System.Drawing.Size(173, 90);
217 ············this.groupBox2.TabIndex = 3;
218 ············this.groupBox2.TabStop = false;
219 ············this.groupBox2.Text = " Relation Type··";
220 ············//
221 ············// radioAggregate
222 ············//
223 ············this.radioAggregate.Location = new System.Drawing.Point(30, 60);
224 ············this.radioAggregate.Name = "radioAggregate";
225 ············this.radioAggregate.Size = new System.Drawing.Size(127, 21);
226 ············this.radioAggregate.TabIndex = 1;
227 ············this.radioAggregate.Text = "Assoziation";
228 ············this.toolTip1.SetToolTip(this.radioAggregate, "Relation contains independent objects with own life-cycles");
229 ············//
230 ············// radioComposite
231 ············//
232 ············this.radioComposite.Checked = true;
233 ············this.radioComposite.Location = new System.Drawing.Point(30, 35);
234 ············this.radioComposite.Name = "radioComposite";
235 ············this.radioComposite.Size = new System.Drawing.Size(127, 21);
236 ············this.radioComposite.TabIndex = 0;
237 ············this.radioComposite.TabStop = true;
238 ············this.radioComposite.Text = "Composition";
239 ············this.toolTip1.SetToolTip(this.radioComposite, "Life-cycle of the related objects are coupled to the lifetime of the owner");
240 ············//
241 ············// btnOK
242 ············//
243 ············this.btnOK.DialogResult = System.Windows.Forms.DialogResult.OK;
244 ············this.btnOK.Enabled = false;
245 ············this.btnOK.Location = new System.Drawing.Point(297, 343);
246 ············this.btnOK.Name = "btnOK";
247 ············this.btnOK.Size = new System.Drawing.Size(107, 28);
248 ············this.btnOK.TabIndex = 7;
249 ············this.btnOK.Text = "OK";
250 ············//
251 ············// btnCancel
252 ············//
253 ············this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
254 ············this.btnCancel.Location = new System.Drawing.Point(177, 343);
255 ············this.btnCancel.Name = "btnCancel";
256 ············this.btnCancel.Size = new System.Drawing.Size(107, 28);
257 ············this.btnCancel.TabIndex = 6;
258 ············this.btnCancel.Text = "Cancel";
259 ············//
260 ············// txtElementType
261 ············//
262 ············this.txtElementType.Location = new System.Drawing.Point(137, 24);
263 ············this.txtElementType.Name = "txtElementType";
264 ············this.txtElementType.Size = new System.Drawing.Size(267, 20);
265 ············this.txtElementType.TabIndex = 0;
266 ············this.toolTip1.SetToolTip(this.txtElementType, "Type of the related objects");
267 ············this.txtElementType.TextChanged += new System.EventHandler(this.txtElementType_TextChanged);
268 ············//
269 ············// label2
270 ············//
271 ············this.label2.Location = new System.Drawing.Point(44, 24);
272 ············this.label2.Name = "label2";
273 ············this.label2.Size = new System.Drawing.Size(80, 21);
274 ············this.label2.TabIndex = 8;
275 ············this.label2.Text = "Element Type";
276 ············//
277 ············// txtRoleName
278 ············//
279 ············this.txtRoleName.Location = new System.Drawing.Point(137, 93);
280 ············this.txtRoleName.Name = "txtRoleName";
281 ············this.txtRoleName.Size = new System.Drawing.Size(267, 20);
282 ············this.txtRoleName.TabIndex = 2;
283 ············this.toolTip1.SetToolTip(this.txtRoleName, "Name of the variable in which the relation is stored");
284 ············//
285 ············// radioArrayList
286 ············//
287 ············this.radioArrayList.Checked = true;
288 ············this.radioArrayList.Location = new System.Drawing.Point(30, 60);
289 ············this.radioArrayList.Name = "radioArrayList";
290 ············this.radioArrayList.Size = new System.Drawing.Size(127, 21);
291 ············this.radioArrayList.TabIndex = 1;
292 ············this.radioArrayList.TabStop = true;
293 ············this.radioArrayList.Text = "List<T>";
294 ············this.toolTip1.SetToolTip(this.radioArrayList, "Relation contains independent objects with own life-cycles");
295 ············//
296 ············// radioIList
297 ············//
298 ············this.radioIList.Location = new System.Drawing.Point(30, 35);
299 ············this.radioIList.Name = "radioIList";
300 ············this.radioIList.Size = new System.Drawing.Size(127, 21);
301 ············this.radioIList.TabIndex = 0;
302 ············this.radioIList.Text = "IList<T>";
303 ············this.toolTip1.SetToolTip(this.radioIList, "Life-cycle of the related objects are coupled to the lifetime of the owner");
304 ············//
305 ············// label3
306 ············//
307 ············this.label3.Location = new System.Drawing.Point(43, 91);
308 ············this.label3.Name = "label3";
309 ············this.label3.Size = new System.Drawing.Size(86, 28);
310 ············this.label3.TabIndex = 15;
311 ············this.label3.Text = "Optional Role Name";
312 ············//
313 ············// groupBox3
314 ············//
315 ············this.groupBox3.Controls.Add(this.chkUseGenerics);
316 ············this.groupBox3.Controls.Add(this.radioArrayList);
317 ············this.groupBox3.Controls.Add(this.radioIList);
318 ············this.groupBox3.Location = new System.Drawing.Point(44, 225);
319 ············this.groupBox3.Name = "groupBox3";
320 ············this.groupBox3.Size = new System.Drawing.Size(360, 91);
321 ············this.groupBox3.TabIndex = 5;
322 ············this.groupBox3.TabStop = false;
323 ············this.groupBox3.Text = " Coding Style··";
324 ············//
325 ············// chkUseGenerics
326 ············//
327 ············this.chkUseGenerics.Checked = true;
328 ············this.chkUseGenerics.CheckState = System.Windows.Forms.CheckState.Checked;
329 ············this.chkUseGenerics.Location = new System.Drawing.Point(204, 35);
330 ············this.chkUseGenerics.Name = "chkUseGenerics";
331 ············this.chkUseGenerics.Size = new System.Drawing.Size(160, 21);
332 ············this.chkUseGenerics.TabIndex = 3;
333 ············this.chkUseGenerics.Text = "Use Generics";
334 ············this.chkUseGenerics.CheckedChanged += new System.EventHandler(this.chkUseGenerics_CheckedChanged);
335 ············//
336 ············// RelationDialog
337 ············//
338 ············this.AcceptButton = this.btnOK;
339 ············this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
340 ············this.CancelButton = this.btnCancel;
341 ············this.ClientSize = new System.Drawing.Size(448, 403);
342 ············this.Controls.Add(this.groupBox3);
343 ············this.Controls.Add(this.txtRoleName);
344 ············this.Controls.Add(this.label3);
345 ············this.Controls.Add(this.label2);
346 ············this.Controls.Add(this.txtElementType);
347 ············this.Controls.Add(this.txtFieldName);
348 ············this.Controls.Add(this.btnCancel);
349 ············this.Controls.Add(this.btnOK);
350 ············this.Controls.Add(this.groupBox2);
351 ············this.Controls.Add(this.groupBox1);
352 ············this.Controls.Add(this.label1);
353 ············this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
354 ············this.Name = "RelationDialog";
355 ············this.Text = "Add Relation";
356 ············this.groupBox1.ResumeLayout(false);
357 ············this.groupBox2.ResumeLayout(false);
358 ············this.groupBox3.ResumeLayout(false);
359 ············this.ResumeLayout(false);
360 ············this.PerformLayout();
361
362 ········}
363 ········#endregion
364
365 ········private void txtElementType_TextChanged(object sender, System.EventArgs e)
366 ········{
367 ············this.btnOK.Enabled = (txtElementType.Text.Trim() != "" && txtFieldName.Text.Trim() != "");
368 ········}
369
370 ········private void txtFieldName_TextChanged(object sender, System.EventArgs e)
371 ········{
372 ············this.btnOK.Enabled = (txtElementType.Text.Trim() != "" && txtFieldName.Text.Trim() != "");
373 ········}
374
375 ········private void radioSingle_CheckedChanged(object sender, System.EventArgs e)
376 ········{
377 ············this.chkUseGenerics.Enabled =
378 ················this.radioArrayList.Enabled =
379 ················this.radioIList.Enabled = !radioSingle.Checked;
380 ········}
381
382 ········private void chkUseGenerics_CheckedChanged(object sender, EventArgs e)
383 ········{
384 ············if (chkUseGenerics.Checked)
385 ············{
386 ················radioArrayList.Text = "List<T>";
387 ················radioIList.Text = "IList<T>";
388 ············}
389 ············else
390 ············{
391 ················radioArrayList.Text = "ArrayList";
392 ················radioArrayList.Checked = true;
393 ················radioIList.Text = "IList";
394 ············}
395 ········}
396 ····}
397 }
 
 
 
398