Datei: NDOPackage/PersistentClassDialog.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 | ····/// <summary> |
32 | ····/// Zusammenfassung für PersistentClassDialog. |
33 | ····/// </summary> |
34 | ····internal class PersistentClassDialog : System.Windows.Forms.Form |
35 | ····{ |
36 | ········private System.Windows.Forms.Label label1; |
37 | ········ |
38 | ········private DialogResult result; |
39 | ········public DialogResult Result { get { return this.result; } } |
40 | ········public string ClassName { get { return this.txtClassName.Text; } } |
41 | ········public bool Serializable { get { return this.chkSerializable.Checked; } } |
42 | |
43 | ········private System.Windows.Forms.TextBox txtClassName; |
44 | ········private System.Windows.Forms.Button btnCancel; |
45 | ········private System.Windows.Forms.Button btnOK; |
46 | ········private System.Windows.Forms.CheckBox chkSerializable; |
47 | |
48 | ········/// <summary> |
49 | ········/// Erforderliche Designervariable. |
50 | ········/// </summary> |
51 | ········private System.ComponentModel.Container components = null; |
52 | |
53 | ········public PersistentClassDialog() |
54 | ········{ |
55 | ············// |
56 | ············// Erforderlich für die Windows Form-Designerunterstützung |
57 | ············// |
58 | ············InitializeComponent(); |
59 | |
60 | ············// |
61 | ············// TODO: Fügen Sie den Konstruktorcode nach dem Aufruf von InitializeComponent hinzu |
62 | ············// |
63 | ········} |
64 | |
65 | ········/// <summary> |
66 | ········/// Die verwendeten Ressourcen bereinigen. |
67 | ········/// </summary> |
68 | ········protected override void Dispose( bool disposing ) |
69 | ········{ |
70 | ············if( disposing ) |
71 | ············{ |
72 | ················if(components != null) |
73 | ················{ |
74 | ····················components.Dispose(); |
75 | ················} |
76 | ············} |
77 | ············base.Dispose( disposing ); |
78 | ········} |
79 | |
80 | ········#region Vom Windows Form-Designer generierter Code |
81 | ········/// <summary> |
82 | ········/// Erforderliche Methode für die Designerunterstützung. |
83 | ········/// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden. |
84 | ········/// </summary> |
85 | ········private void InitializeComponent() |
86 | ········{ |
87 | ············System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(PersistentClassDialog)); |
88 | ············this.txtClassName = new System.Windows.Forms.TextBox(); |
89 | ············this.label1 = new System.Windows.Forms.Label(); |
90 | ············this.btnCancel = new System.Windows.Forms.Button(); |
91 | ············this.btnOK = new System.Windows.Forms.Button(); |
92 | ············this.chkSerializable = new System.Windows.Forms.CheckBox(); |
93 | ············this.SuspendLayout(); |
94 | ············// |
95 | ············// txtClassName |
96 | ············// |
97 | ············this.txtClassName.Location = new System.Drawing.Point(16, 64); |
98 | ············this.txtClassName.Name = "txtClassName"; |
99 | ············this.txtClassName.Size = new System.Drawing.Size(400, 22); |
100 | ············this.txtClassName.TabIndex = 0; |
101 | ············this.txtClassName.Text = ""; |
102 | ············// |
103 | ············// label1 |
104 | ············// |
105 | ············this.label1.Location = new System.Drawing.Point(16, 24); |
106 | ············this.label1.Name = "label1"; |
107 | ············this.label1.Size = new System.Drawing.Size(168, 24); |
108 | ············this.label1.TabIndex = 1; |
109 | ············this.label1.Text = "Class Name"; |
110 | ············// |
111 | ············// btnCancel |
112 | ············// |
113 | ············this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; |
114 | ············this.btnCancel.Location = new System.Drawing.Point(104, 152); |
115 | ············this.btnCancel.Name = "btnCancel"; |
116 | ············this.btnCancel.Size = new System.Drawing.Size(144, 32); |
117 | ············this.btnCancel.TabIndex = 2; |
118 | ············this.btnCancel.Text = "Cancel"; |
119 | ············this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click); |
120 | ············// |
121 | ············// btnOK |
122 | ············// |
123 | ············this.btnOK.DialogResult = System.Windows.Forms.DialogResult.OK; |
124 | ············this.btnOK.Location = new System.Drawing.Point(264, 152); |
125 | ············this.btnOK.Name = "btnOK"; |
126 | ············this.btnOK.Size = new System.Drawing.Size(144, 32); |
127 | ············this.btnOK.TabIndex = 3; |
128 | ············this.btnOK.Text = "OK"; |
129 | ············this.btnOK.Click += new System.EventHandler(this.btnOK_Click); |
130 | ············// |
131 | ············// chkSerializable |
132 | ············// |
133 | ············this.chkSerializable.Location = new System.Drawing.Point(16, 104); |
134 | ············this.chkSerializable.Name = "chkSerializable"; |
135 | ············this.chkSerializable.Size = new System.Drawing.Size(240, 24); |
136 | ············this.chkSerializable.TabIndex = 4; |
137 | ············this.chkSerializable.Text = "Serializable"; |
138 | ············// |
139 | ············// PersistentClassDialog |
140 | ············// |
141 | ············this.AcceptButton = this.btnOK; |
142 | ············this.AutoScaleBaseSize = new System.Drawing.Size(6, 15); |
143 | ············this.CancelButton = this.btnCancel; |
144 | ············this.ClientSize = new System.Drawing.Size(440, 208); |
145 | ············this.Controls.Add(this.chkSerializable); |
146 | ············this.Controls.Add(this.btnOK); |
147 | ············this.Controls.Add(this.btnCancel); |
148 | ············this.Controls.Add(this.label1); |
149 | ············this.Controls.Add(this.txtClassName); |
150 | ············this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); |
151 | ············this.Name = "PersistentClassDialog"; |
152 | ············this.Text = "Add Persistent Class"; |
153 | ············this.ResumeLayout(false); |
154 | |
155 | ········} |
156 | ········#endregion |
157 | |
158 | ········private void btnOK_Click(object sender, System.EventArgs e) |
159 | ········{ |
160 | ············if (this.txtClassName.Text.Trim() == string.Empty) |
161 | ················result = DialogResult.Cancel; |
162 | ············else |
163 | ················result = DialogResult.OK; |
164 | ············this.Close(); |
165 | ········} |
166 | |
167 | ········private void btnCancel_Click(object sender, System.EventArgs e) |
168 | ········{ |
169 | ············result = DialogResult.Cancel; |
170 | ············this.Close(); |
171 | ········} |
172 | |
173 | ····} |
174 | } |
175 | |
176 | ········} |
177 | |
178 | ····} |
179 | } |
180 |
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 | ····/// <summary> |
32 | ····/// Zusammenfassung für PersistentClassDialog. |
33 | ····/// </summary> |
34 | ····internal class PersistentClassDialog : System.Windows.Forms.Form |
35 | ····{ |
36 | ········private System.Windows.Forms.Label label1; |
37 | ········ |
38 | ········private DialogResult result; |
39 | ········public DialogResult Result { get { return this.result; } } |
40 | ········public string ClassName { get { return this.txtClassName.Text; } } |
41 | ········public bool Serializable { get { return this.chkSerializable.Checked; } } |
42 | |
43 | ········private System.Windows.Forms.TextBox txtClassName; |
44 | ········private System.Windows.Forms.Button btnCancel; |
45 | ········private System.Windows.Forms.Button btnOK; |
46 | ········private System.Windows.Forms.CheckBox chkSerializable; |
47 | |
48 | ········/// <summary> |
49 | ········/// Erforderliche Designervariable. |
50 | ········/// </summary> |
51 | ········private System.ComponentModel.Container components = null; |
52 | |
53 | ········public PersistentClassDialog() |
54 | ········{ |
55 | ············// |
56 | ············// Erforderlich für die Windows Form-Designerunterstützung |
57 | ············// |
58 | ············InitializeComponent(); |
59 | |
60 | ············// |
61 | ············// TODO: Fügen Sie den Konstruktorcode nach dem Aufruf von InitializeComponent hinzu |
62 | ············// |
63 | ········} |
64 | |
65 | ········/// <summary> |
66 | ········/// Die verwendeten Ressourcen bereinigen. |
67 | ········/// </summary> |
68 | ········protected override void Dispose( bool disposing ) |
69 | ········{ |
70 | ············if( disposing ) |
71 | ············{ |
72 | ················if(components != null) |
73 | ················{ |
74 | ····················components.Dispose(); |
75 | ················} |
76 | ············} |
77 | ············base.Dispose( disposing ); |
78 | ········} |
79 | |
80 | ········#region Vom Windows Form-Designer generierter Code |
81 | ········/// <summary> |
82 | ········/// Erforderliche Methode für die Designerunterstützung. |
83 | ········/// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden. |
84 | ········/// </summary> |
85 | ········private void InitializeComponent() |
86 | ········{ |
87 | ············System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(PersistentClassDialog)); |
88 | ············this.txtClassName = new System.Windows.Forms.TextBox(); |
89 | ············this.label1 = new System.Windows.Forms.Label(); |
90 | ············this.btnCancel = new System.Windows.Forms.Button(); |
91 | ············this.btnOK = new System.Windows.Forms.Button(); |
92 | ············this.chkSerializable = new System.Windows.Forms.CheckBox(); |
93 | ············this.SuspendLayout(); |
94 | ············// |
95 | ············// txtClassName |
96 | ············// |
97 | ············this.txtClassName.Location = new System.Drawing.Point(16, 64); |
98 | ············this.txtClassName.Name = "txtClassName"; |
99 | ············this.txtClassName.Size = new System.Drawing.Size(400, 22); |
100 | ············this.txtClassName.TabIndex = 0; |
101 | ············this.txtClassName.Text = ""; |
102 | ············// |
103 | ············// label1 |
104 | ············// |
105 | ············this.label1.Location = new System.Drawing.Point(16, 24); |
106 | ············this.label1.Name = "label1"; |
107 | ············this.label1.Size = new System.Drawing.Size(168, 24); |
108 | ············this.label1.TabIndex = 1; |
109 | ············this.label1.Text = "Class Name"; |
110 | ············// |
111 | ············// btnCancel |
112 | ············// |
113 | ············this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; |
114 | ············this.btnCancel.Location = new System.Drawing.Point(104, 152); |
115 | ············this.btnCancel.Name = "btnCancel"; |
116 | ············this.btnCancel.Size = new System.Drawing.Size(144, 32); |
117 | ············this.btnCancel.TabIndex = 2; |
118 | ············this.btnCancel.Text = "Cancel"; |
119 | ············this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click); |
120 | ············// |
121 | ············// btnOK |
122 | ············// |
123 | ············this.btnOK.DialogResult = System.Windows.Forms.DialogResult.OK; |
124 | ············this.btnOK.Location = new System.Drawing.Point(264, 152); |
125 | ············this.btnOK.Name = "btnOK"; |
126 | ············this.btnOK.Size = new System.Drawing.Size(144, 32); |
127 | ············this.btnOK.TabIndex = 3; |
128 | ············this.btnOK.Text = "OK"; |
129 | ············this.btnOK.Click += new System.EventHandler(this.btnOK_Click); |
130 | ············// |
131 | ············// chkSerializable |
132 | ············// |
133 | ············this.chkSerializable.Location = new System.Drawing.Point(16, 104); |
134 | ············this.chkSerializable.Name = "chkSerializable"; |
135 | ············this.chkSerializable.Size = new System.Drawing.Size(240, 24); |
136 | ············this.chkSerializable.TabIndex = 4; |
137 | ············this.chkSerializable.Text = "Serializable"; |
138 | ············// |
139 | ············// PersistentClassDialog |
140 | ············// |
141 | ············this.AcceptButton = this.btnOK; |
142 | ············this.AutoScaleBaseSize = new System.Drawing.Size(6, 15); |
143 | ············this.CancelButton = this.btnCancel; |
144 | ············this.ClientSize = new System.Drawing.Size(440, 208); |
145 | ············this.Controls.Add(this.chkSerializable); |
146 | ············this.Controls.Add(this.btnOK); |
147 | ············this.Controls.Add(this.btnCancel); |
148 | ············this.Controls.Add(this.label1); |
149 | ············this.Controls.Add(this.txtClassName); |
150 | ············this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); |
151 | ············this.Name = "PersistentClassDialog"; |
152 | ············this.Text = "Add Persistent Class"; |
153 | ············this.ResumeLayout(false); |
154 | |
155 | ········} |
156 | ········#endregion |
157 | |
158 | ········private void btnOK_Click(object sender, System.EventArgs e) |
159 | ········{ |
160 | ············if (this.txtClassName.Text.Trim() == string.Empty) |
161 | ················result = DialogResult.Cancel; |
162 | ············else |
163 | ················result = DialogResult.OK; |
164 | ············this.Close(); |
165 | ········} |
166 | |
167 | ········private void btnCancel_Click(object sender, System.EventArgs e) |
168 | ········{ |
169 | ············result = DialogResult.Cancel; |
170 | ············this.Close(); |
171 | ········} |
172 | |
173 | ····} |
174 | } |
175 | |