Datei: SimpleMappingTool/AddPropertyDialog.cs

Last Commit (8c4b1f0)
1 //
2 // Copyright (c) 2002-2016 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.Reflection;
25 using System.Drawing;
26 using System.Collections;
27 using System.ComponentModel;
28 using System.Windows.Forms;
29 using NDO;
30
31 namespace SimpleMappingTool
32 {
33 ····/// <summary>
34 ····/// Zusammenfassung für AddPropertyDialog.
35 ····/// </summary>
36 ····public class AddPropertyDialog : System.Windows.Forms.Form
37 ····{
38 ········private System.Windows.Forms.Label label1;
39 ········private System.Windows.Forms.Label label2;
40 ········private System.Windows.Forms.Label label3;
41 ········private System.Windows.Forms.Button btnCancel;
42 ········private System.Windows.Forms.Button btnOK;
43 ········private System.Windows.Forms.TextBox txtName;
44 ········private System.Windows.Forms.TextBox txtValue;
45 ········private System.Windows.Forms.ComboBox cbTypes;
46 ········private System.Windows.Forms.Label label4;
47 ········/// <summary>
48 ········/// Erforderliche Designervariable.
49 ········/// </summary>
50 ········private System.ComponentModel.Container components = null;
51
 
 
 
 
 
 
 
52 ········public string PropName
53 ········{
54 ············get { return this.txtName.Text; }
55 ············set { this.txtName.Text = value; }
56 ········}
57
58 ········public string Value
59 ········{
60 ············get { return this.txtValue.Text; }
61 ············set { this.txtValue.Text = value; }
62 ········}
63
64 ········public string Type
65 ········{
66 ············get { return this.cbTypes.Text; }
67 ············set { this.cbTypes.Text = value; }
68 ········}
69
70 ········public bool EditProperty
71 ········{
72 ············get { return !this.txtName.Enabled; }
73 ············set { this.txtName.Enabled = !value; }
74 ········}
75
76 ········public AddPropertyDialog()
77 ········{
78 ············//
79 ············// Erforderlich für die Windows Form-Designerunterstützung
80 ············//
81 ············InitializeComponent();
82 ············
83 this. cbTypes. DataSource = NDOProperty. BuiltInTypes;
84 ········}
85
86 ········/// <summary>
87 ········/// Die verwendeten Ressourcen bereinigen.
88 ········/// </summary>
89 ········protected override void Dispose( bool disposing )
90 ········{
91 ············if( disposing )
92 ············{
93 ················if(components != null)
94 ················{
95 ····················components.Dispose();
96 ················}
97 ············}
98 ············base.Dispose( disposing );
99 ········}
100
101 ········#region Vom Windows Form-Designer generierter Code
102 ········/// <summary>
103 ········/// Erforderliche Methode für die Designerunterstützung.
104 ········/// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden.
105 ········/// </summary>
106 ········private void InitializeComponent()
107 ········{
108 ············System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(AddPropertyDialog));
109 ············this.txtName = new System.Windows.Forms.TextBox();
110 ············this.txtValue = new System.Windows.Forms.TextBox();
111 ············this.label1 = new System.Windows.Forms.Label();
112 ············this.label2 = new System.Windows.Forms.Label();
113 ············this.cbTypes = new System.Windows.Forms.ComboBox();
114 ············this.label3 = new System.Windows.Forms.Label();
115 ············this.btnCancel = new System.Windows.Forms.Button();
116 ············this.btnOK = new System.Windows.Forms.Button();
117 ············this.label4 = new System.Windows.Forms.Label();
118 ············this.SuspendLayout();
119 ············//
120 ············// txtName
121 ············//
122 ············this.txtName.Location = new System.Drawing.Point(152, 24);
123 ············this.txtName.Name = "txtName";
124 ············this.txtName.Size = new System.Drawing.Size(264, 22);
125 ············this.txtName.TabIndex = 0;
126 ············this.txtName.Text = "";
127 ············//
128 ············// txtValue
129 ············//
130 ············this.txtValue.Location = new System.Drawing.Point(152, 56);
131 ············this.txtValue.Name = "txtValue";
132 ············this.txtValue.Size = new System.Drawing.Size(264, 22);
133 ············this.txtValue.TabIndex = 1;
134 ············this.txtValue.Text = "";
135 ············//
136 ············// label1
137 ············//
138 ············this.label1.Location = new System.Drawing.Point(24, 24);
139 ············this.label1.Name = "label1";
140 ············this.label1.Size = new System.Drawing.Size(120, 24);
141 ············this.label1.TabIndex = 2;
142 ············this.label1.Text = "Name";
143 ············//
144 ············// label2
145 ············//
146 ············this.label2.Location = new System.Drawing.Point(24, 56);
147 ············this.label2.Name = "label2";
148 ············this.label2.Size = new System.Drawing.Size(120, 24);
149 ············this.label2.TabIndex = 3;
150 ············this.label2.Text = "Value";
151 ············//
152 ············// cbTypes
153 ············//
154 ············this.cbTypes.CausesValidation = false;
155 ············this.cbTypes.Location = new System.Drawing.Point(152, 88);
156 ············this.cbTypes.Name = "cbTypes";
157 ············this.cbTypes.Size = new System.Drawing.Size(264, 24);
158 ············this.cbTypes.TabIndex = 4;
159 ············//
160 ············// label3
161 ············//
162 ············this.label3.Location = new System.Drawing.Point(24, 88);
163 ············this.label3.Name = "label3";
164 ············this.label3.Size = new System.Drawing.Size(120, 24);
165 ············this.label3.TabIndex = 5;
166 ············this.label3.Text = "Type";
167 ············//
168 ············// btnCancel
169 ············//
170 ············this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
171 ············this.btnCancel.Location = new System.Drawing.Point(304, 160);
172 ············this.btnCancel.Name = "btnCancel";
173 ············this.btnCancel.Size = new System.Drawing.Size(112, 32);
174 ············this.btnCancel.TabIndex = 6;
175 ············this.btnCancel.Text = "Cancel";
176 ············//
177 ············// btnOK
178 ············//
179 ············this.btnOK.DialogResult = System.Windows.Forms.DialogResult.OK;
180 ············this.btnOK.Location = new System.Drawing.Point(176, 160);
181 ············this.btnOK.Name = "btnOK";
182 ············this.btnOK.Size = new System.Drawing.Size(112, 32);
183 ············this.btnOK.TabIndex = 7;
184 ············this.btnOK.Text = "OK";
185 ············//
186 ············// label4
187 ············//
188 ············this.label4.Location = new System.Drawing.Point(24, 120);
189 ············this.label4.Name = "label4";
190 ············this.label4.Size = new System.Drawing.Size(392, 40);
191 ············this.label4.TabIndex = 8;
192 ············this.label4.Text = "Use the NDOProperty class to convert the value and type strings into .NET objects" +
193 ················" of the given type.";
194 ············//
195 ············// AddPropertyDialog
196 ············//
197 ············this.AcceptButton = this.btnOK;
198 ············this.AutoScaleBaseSize = new System.Drawing.Size(6, 15);
199 ············this.CancelButton = this.btnCancel;
200 ············this.ClientSize = new System.Drawing.Size(448, 206);
201 ············this.Controls.Add(this.label4);
202 ············this.Controls.Add(this.btnOK);
203 ············this.Controls.Add(this.btnCancel);
204 ············this.Controls.Add(this.label3);
205 ············this.Controls.Add(this.cbTypes);
206 ············this.Controls.Add(this.label2);
207 ············this.Controls.Add(this.label1);
208 ············this.Controls.Add(this.txtValue);
209 ············this.Controls.Add(this.txtName);
210 ············this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
211 ············this.Name = "AddPropertyDialog";
212 ············this.Text = "Add Property";
213 ············this.ResumeLayout(false);
214
215 ········}
216 ········#endregion
217
218 ····}
219 }
220
New Commit (db278e7)
1 //
2 // Copyright (c) 2002-2016 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.Reflection;
25 using System.Drawing;
26 using System.Collections;
27 using System.ComponentModel;
28 using System.Windows.Forms;
29 using NDO;
30
31 namespace SimpleMappingTool
32 {
33 ····/// <summary>
34 ····/// Zusammenfassung für AddPropertyDialog.
35 ····/// </summary>
36 ····public class AddPropertyDialog : System.Windows.Forms.Form
37 ····{
38 ········private System.Windows.Forms.Label label1;
39 ········private System.Windows.Forms.Label label2;
40 ········private System.Windows.Forms.Label label3;
41 ········private System.Windows.Forms.Button btnCancel;
42 ········private System.Windows.Forms.Button btnOK;
43 ········private System.Windows.Forms.TextBox txtName;
44 ········private System.Windows.Forms.TextBox txtValue;
45 ········private System.Windows.Forms.ComboBox cbTypes;
46 ········private System.Windows.Forms.Label label4;
47 ········/// <summary>
48 ········/// Erforderliche Designervariable.
49 ········/// </summary>
50 ········private System.ComponentModel.Container components = null;
51
52 ········static readonly string[] builtInTypes =
53 ········{
54 ············"System.Boolean", "System.Char", "System.SByte", "System.Byte", "System.Int16", "System.UInt16", "System.Int32", "System.UInt32", "System.Int64", "System.UInt64",
55 ············"System.Single", "System.Double", "System.Decimal", "System.DateTime", "System.String"
56 ········};
57
58
59 ········public string PropName
60 ········{
61 ············get { return this.txtName.Text; }
62 ············set { this.txtName.Text = value; }
63 ········}
64
65 ········public string Value
66 ········{
67 ············get { return this.txtValue.Text; }
68 ············set { this.txtValue.Text = value; }
69 ········}
70
71 ········public string Type
72 ········{
73 ············get { return this.cbTypes.Text; }
74 ············set { this.cbTypes.Text = value; }
75 ········}
76
77 ········public bool EditProperty
78 ········{
79 ············get { return !this.txtName.Enabled; }
80 ············set { this.txtName.Enabled = !value; }
81 ········}
82
83 ········public AddPropertyDialog()
84 ········{
85 ············//
86 ············// Erforderlich für die Windows Form-Designerunterstützung
87 ············//
88 ············InitializeComponent();
89 ············
90 this. cbTypes. DataSource = builtInTypes;
91 ········}
92
93 ········/// <summary>
94 ········/// Die verwendeten Ressourcen bereinigen.
95 ········/// </summary>
96 ········protected override void Dispose( bool disposing )
97 ········{
98 ············if( disposing )
99 ············{
100 ················if(components != null)
101 ················{
102 ····················components.Dispose();
103 ················}
104 ············}
105 ············base.Dispose( disposing );
106 ········}
107
108 ········#region Vom Windows Form-Designer generierter Code
109 ········/// <summary>
110 ········/// Erforderliche Methode für die Designerunterstützung.
111 ········/// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden.
112 ········/// </summary>
113 ········private void InitializeComponent()
114 ········{
115 ············System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(AddPropertyDialog));
116 ············this.txtName = new System.Windows.Forms.TextBox();
117 ············this.txtValue = new System.Windows.Forms.TextBox();
118 ············this.label1 = new System.Windows.Forms.Label();
119 ············this.label2 = new System.Windows.Forms.Label();
120 ············this.cbTypes = new System.Windows.Forms.ComboBox();
121 ············this.label3 = new System.Windows.Forms.Label();
122 ············this.btnCancel = new System.Windows.Forms.Button();
123 ············this.btnOK = new System.Windows.Forms.Button();
124 ············this.label4 = new System.Windows.Forms.Label();
125 ············this.SuspendLayout();
126 ············//
127 ············// txtName
128 ············//
129 ············this.txtName.Location = new System.Drawing.Point(152, 24);
130 ············this.txtName.Name = "txtName";
131 ············this.txtName.Size = new System.Drawing.Size(264, 22);
132 ············this.txtName.TabIndex = 0;
133 ············this.txtName.Text = "";
134 ············//
135 ············// txtValue
136 ············//
137 ············this.txtValue.Location = new System.Drawing.Point(152, 56);
138 ············this.txtValue.Name = "txtValue";
139 ············this.txtValue.Size = new System.Drawing.Size(264, 22);
140 ············this.txtValue.TabIndex = 1;
141 ············this.txtValue.Text = "";
142 ············//
143 ············// label1
144 ············//
145 ············this.label1.Location = new System.Drawing.Point(24, 24);
146 ············this.label1.Name = "label1";
147 ············this.label1.Size = new System.Drawing.Size(120, 24);
148 ············this.label1.TabIndex = 2;
149 ············this.label1.Text = "Name";
150 ············//
151 ············// label2
152 ············//
153 ············this.label2.Location = new System.Drawing.Point(24, 56);
154 ············this.label2.Name = "label2";
155 ············this.label2.Size = new System.Drawing.Size(120, 24);
156 ············this.label2.TabIndex = 3;
157 ············this.label2.Text = "Value";
158 ············//
159 ············// cbTypes
160 ············//
161 ············this.cbTypes.CausesValidation = false;
162 ············this.cbTypes.Location = new System.Drawing.Point(152, 88);
163 ············this.cbTypes.Name = "cbTypes";
164 ············this.cbTypes.Size = new System.Drawing.Size(264, 24);
165 ············this.cbTypes.TabIndex = 4;
166 ············//
167 ············// label3
168 ············//
169 ············this.label3.Location = new System.Drawing.Point(24, 88);
170 ············this.label3.Name = "label3";
171 ············this.label3.Size = new System.Drawing.Size(120, 24);
172 ············this.label3.TabIndex = 5;
173 ············this.label3.Text = "Type";
174 ············//
175 ············// btnCancel
176 ············//
177 ············this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
178 ············this.btnCancel.Location = new System.Drawing.Point(304, 160);
179 ············this.btnCancel.Name = "btnCancel";
180 ············this.btnCancel.Size = new System.Drawing.Size(112, 32);
181 ············this.btnCancel.TabIndex = 6;
182 ············this.btnCancel.Text = "Cancel";
183 ············//
184 ············// btnOK
185 ············//
186 ············this.btnOK.DialogResult = System.Windows.Forms.DialogResult.OK;
187 ············this.btnOK.Location = new System.Drawing.Point(176, 160);
188 ············this.btnOK.Name = "btnOK";
189 ············this.btnOK.Size = new System.Drawing.Size(112, 32);
190 ············this.btnOK.TabIndex = 7;
191 ············this.btnOK.Text = "OK";
192 ············//
193 ············// label4
194 ············//
195 ············this.label4.Location = new System.Drawing.Point(24, 120);
196 ············this.label4.Name = "label4";
197 ············this.label4.Size = new System.Drawing.Size(392, 40);
198 ············this.label4.TabIndex = 8;
199 ············this.label4.Text = "Use the NDOProperty class to convert the value and type strings into .NET objects" +
200 ················" of the given type.";
201 ············//
202 ············// AddPropertyDialog
203 ············//
204 ············this.AcceptButton = this.btnOK;
205 ············this.AutoScaleBaseSize = new System.Drawing.Size(6, 15);
206 ············this.CancelButton = this.btnCancel;
207 ············this.ClientSize = new System.Drawing.Size(448, 206);
208 ············this.Controls.Add(this.label4);
209 ············this.Controls.Add(this.btnOK);
210 ············this.Controls.Add(this.btnCancel);
211 ············this.Controls.Add(this.label3);
212 ············this.Controls.Add(this.cbTypes);
213 ············this.Controls.Add(this.label2);
214 ············this.Controls.Add(this.label1);
215 ············this.Controls.Add(this.txtValue);
216 ············this.Controls.Add(this.txtName);
217 ············this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
218 ············this.Name = "AddPropertyDialog";
219 ············this.Text = "Add Property";
220 ············this.ResumeLayout(false);
221
222 ········}
223 ········#endregion
224
225 ····}
226 }
227