~ifolder-dev/simias/trunk-packaging

« back to all changes in this revision

Viewing changes to tools/FormsStoreBrowser/.svn/text-base/SearchEditor.cs.svn-base

  • Committer: Jorge O. Castro
  • Date: 2007-12-03 06:56:46 UTC
  • Revision ID: jorge@ubuntu.com-20071203065646-mupcnjcwgm5mnhyt
* Remove a bunch of .svn directories we no longer need.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
using System;
2
 
using System.Collections;
3
 
using System.ComponentModel;
4
 
using System.Drawing;
5
 
using System.Data;
6
 
using System.Windows.Forms;
7
 
 
8
 
namespace StoreBrowser
9
 
{
10
 
        /// <summary>
11
 
        /// Summary description for SearchEditor.
12
 
        /// </summary>
13
 
        public class SearchEditor : System.Windows.Forms.UserControl
14
 
        {
15
 
                private IStoreBrowser browser;
16
 
//              private Search search;
17
 
                private TreeNode tNode;
18
 
                private System.Windows.Forms.TextBox target;
19
 
                private System.Windows.Forms.TextBox propertyName;
20
 
                private System.Windows.Forms.Label label1;
21
 
                private System.Windows.Forms.GroupBox groupBox1;
22
 
                private System.Windows.Forms.Label label2;
23
 
                private System.Windows.Forms.ComboBox propertyType;
24
 
                private System.Windows.Forms.Label label3;
25
 
                private System.Windows.Forms.TextBox propertyValue;
26
 
                private System.Windows.Forms.ComboBox operation;
27
 
                private System.Windows.Forms.Label label4;
28
 
                private System.Windows.Forms.Label label5;
29
 
                private System.Windows.Forms.Button searchButton;
30
 
                /// <summary> 
31
 
                /// Required designer variable.
32
 
                /// </summary>
33
 
                private System.ComponentModel.Container components = null;
34
 
 
35
 
                public SearchEditor()
36
 
                {
37
 
                        // This call is required by the Windows.Forms Form Designer.
38
 
                        InitializeComponent();
39
 
                }
40
 
 
41
 
                #region Properties
42
 
                public Button SearchButton
43
 
                {
44
 
                        get
45
 
                        {
46
 
                                return searchButton;
47
 
                        }
48
 
                }
49
 
 
50
 
                public IStoreBrowser Browser
51
 
                {
52
 
                        set
53
 
                        {
54
 
                                browser = value;
55
 
                        }
56
 
                }
57
 
 
58
 
                public TreeNode SearchNode
59
 
                {
60
 
                        set
61
 
                        {
62
 
                                tNode = value;
63
 
 
64
 
                                SearchExpression search = (SearchExpression)tNode.Tag;
65
 
                                if ( search != null && search.Target != null )
66
 
                                {
67
 
                                        target.Text = search.Target.Name;
68
 
                                        propertyName.Text = search.PropertyName;
69
 
                                        propertyType.Text = search.PropertyType;
70
 
                                        propertyValue.Text = search.PropertyValue;
71
 
                                        operation.Text = search.Operation;
72
 
                                }
73
 
                                else
74
 
                                {
75
 
                                        target.Text = "Store";
76
 
 
77
 
                                        propertyName.Text = search.PropertyName;
78
 
                                        propertyType.Text = search.PropertyType;
79
 
                                        propertyValue.Text = search.PropertyValue;
80
 
                                        operation.Text = search.Operation;
81
 
                                }
82
 
                        }
83
 
                }
84
 
                #endregion
85
 
 
86
 
                /// <summary> 
87
 
                /// Clean up any resources being used.
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 Component Designer generated code
102
 
                /// <summary> 
103
 
                /// Required method for Designer support - do not modify 
104
 
                /// the contents of this method with the code editor.
105
 
                /// </summary>
106
 
                private void InitializeComponent()
107
 
                {
108
 
                        this.target = new System.Windows.Forms.TextBox();
109
 
                        this.propertyName = new System.Windows.Forms.TextBox();
110
 
                        this.label1 = new System.Windows.Forms.Label();
111
 
                        this.groupBox1 = new System.Windows.Forms.GroupBox();
112
 
                        this.propertyValue = new System.Windows.Forms.TextBox();
113
 
                        this.label3 = new System.Windows.Forms.Label();
114
 
                        this.propertyType = new System.Windows.Forms.ComboBox();
115
 
                        this.label2 = new System.Windows.Forms.Label();
116
 
                        this.operation = new System.Windows.Forms.ComboBox();
117
 
                        this.label4 = new System.Windows.Forms.Label();
118
 
                        this.label5 = new System.Windows.Forms.Label();
119
 
                        this.searchButton = new System.Windows.Forms.Button();
120
 
                        this.groupBox1.SuspendLayout();
121
 
                        this.SuspendLayout();
122
 
                        // 
123
 
                        // target
124
 
                        // 
125
 
                        this.target.Location = new System.Drawing.Point(96, 16);
126
 
                        this.target.Name = "target";
127
 
                        this.target.ReadOnly = true;
128
 
                        this.target.Size = new System.Drawing.Size(288, 20);
129
 
                        this.target.TabIndex = 0;
130
 
                        this.target.Text = "";
131
 
                        // 
132
 
                        // propertyName
133
 
                        // 
134
 
                        this.propertyName.Location = new System.Drawing.Point(56, 24);
135
 
                        this.propertyName.Name = "propertyName";
136
 
                        this.propertyName.Size = new System.Drawing.Size(216, 20);
137
 
                        this.propertyName.TabIndex = 1;
138
 
                        this.propertyName.Text = "";
139
 
                        // 
140
 
                        // label1
141
 
                        // 
142
 
                        this.label1.Location = new System.Drawing.Point(16, 26);
143
 
                        this.label1.Name = "label1";
144
 
                        this.label1.Size = new System.Drawing.Size(48, 16);
145
 
                        this.label1.TabIndex = 2;
146
 
                        this.label1.Text = "Name:";
147
 
                        // 
148
 
                        // groupBox1
149
 
                        // 
150
 
                        this.groupBox1.Controls.Add(this.propertyValue);
151
 
                        this.groupBox1.Controls.Add(this.label3);
152
 
                        this.groupBox1.Controls.Add(this.propertyType);
153
 
                        this.groupBox1.Controls.Add(this.label2);
154
 
                        this.groupBox1.Controls.Add(this.propertyName);
155
 
                        this.groupBox1.Controls.Add(this.label1);
156
 
                        this.groupBox1.Location = new System.Drawing.Point(96, 51);
157
 
                        this.groupBox1.Name = "groupBox1";
158
 
                        this.groupBox1.Size = new System.Drawing.Size(288, 120);
159
 
                        this.groupBox1.TabIndex = 3;
160
 
                        this.groupBox1.TabStop = false;
161
 
                        this.groupBox1.Text = "Property";
162
 
                        // 
163
 
                        // propertyValue
164
 
                        // 
165
 
                        this.propertyValue.Location = new System.Drawing.Point(56, 88);
166
 
                        this.propertyValue.Name = "propertyValue";
167
 
                        this.propertyValue.Size = new System.Drawing.Size(216, 20);
168
 
                        this.propertyValue.TabIndex = 6;
169
 
                        this.propertyValue.Text = "";
170
 
                        // 
171
 
                        // label3
172
 
                        // 
173
 
                        this.label3.Location = new System.Drawing.Point(16, 90);
174
 
                        this.label3.Name = "label3";
175
 
                        this.label3.Size = new System.Drawing.Size(48, 16);
176
 
                        this.label3.TabIndex = 5;
177
 
                        this.label3.Text = "Value:";
178
 
                        // 
179
 
                        // propertyType
180
 
                        // 
181
 
                        this.propertyType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
182
 
                        this.propertyType.Items.AddRange(new object[] {
183
 
                                                                                                                          "Boolean",
184
 
                                                                                                                          "Byte",
185
 
                                                                                                                          "Char",
186
 
                                                                                                                          "DateTime",
187
 
                                                                                                                          "Int16",
188
 
                                                                                                                          "Int32",
189
 
                                                                                                                          "Int64",
190
 
                                                                                                                          "Relationship",
191
 
                                                                                                                          "SByte",
192
 
                                                                                                                          "Single",
193
 
                                                                                                                          "String",
194
 
                                                                                                                          "TimeSpan",
195
 
                                                                                                                          "UInt16",
196
 
                                                                                                                          "UInt32",
197
 
                                                                                                                          "UInt64",
198
 
                                                                                                                          "Uri",
199
 
                                                                                                                          "XmlDocument"});
200
 
                        this.propertyType.Location = new System.Drawing.Point(56, 56);
201
 
                        this.propertyType.Name = "propertyType";
202
 
                        this.propertyType.Size = new System.Drawing.Size(216, 21);
203
 
                        this.propertyType.TabIndex = 4;
204
 
                        // 
205
 
                        // label2
206
 
                        // 
207
 
                        this.label2.Location = new System.Drawing.Point(16, 58);
208
 
                        this.label2.Name = "label2";
209
 
                        this.label2.Size = new System.Drawing.Size(56, 16);
210
 
                        this.label2.TabIndex = 3;
211
 
                        this.label2.Text = "Type:";
212
 
                        // 
213
 
                        // operation
214
 
                        // 
215
 
                        this.operation.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
216
 
                        this.operation.Items.AddRange(new object[] {
217
 
                                                                                                                   "Equal",
218
 
                                                                                                                   "Not_Equal",
219
 
                                                                                                                   "Begins",
220
 
                                                                                                                   "Ends",
221
 
                                                                                                                   "Contains",
222
 
                                                                                                                   "Greater",
223
 
                                                                                                                   "Less",
224
 
                                                                                                                   "Greater_Equal",
225
 
                                                                                                                   "Less_Equal",
226
 
                                                                                                                   "Exists",
227
 
                                                                                                                   "CaseEqual"});
228
 
                        this.operation.Location = new System.Drawing.Point(96, 186);
229
 
                        this.operation.Name = "operation";
230
 
                        this.operation.Size = new System.Drawing.Size(288, 21);
231
 
                        this.operation.TabIndex = 4;
232
 
                        // 
233
 
                        // label4
234
 
                        // 
235
 
                        this.label4.Location = new System.Drawing.Point(8, 188);
236
 
                        this.label4.Name = "label4";
237
 
                        this.label4.Size = new System.Drawing.Size(100, 16);
238
 
                        this.label4.TabIndex = 5;
239
 
                        this.label4.Text = "Search operator:";
240
 
                        // 
241
 
                        // label5
242
 
                        // 
243
 
                        this.label5.Location = new System.Drawing.Point(8, 18);
244
 
                        this.label5.Name = "label5";
245
 
                        this.label5.Size = new System.Drawing.Size(100, 16);
246
 
                        this.label5.TabIndex = 7;
247
 
                        this.label5.Text = "Search target:";
248
 
                        // 
249
 
                        // searchButton
250
 
                        // 
251
 
                        this.searchButton.Location = new System.Drawing.Point(296, 222);
252
 
                        this.searchButton.Name = "searchButton";
253
 
                        this.searchButton.Size = new System.Drawing.Size(88, 23);
254
 
                        this.searchButton.TabIndex = 8;
255
 
                        this.searchButton.Text = "&Search";
256
 
                        this.searchButton.Click += new System.EventHandler(this.searchButton_Click);
257
 
                        // 
258
 
                        // SearchEditor
259
 
                        // 
260
 
                        this.Controls.Add(this.searchButton);
261
 
                        this.Controls.Add(this.target);
262
 
                        this.Controls.Add(this.label5);
263
 
                        this.Controls.Add(this.operation);
264
 
                        this.Controls.Add(this.label4);
265
 
                        this.Controls.Add(this.groupBox1);
266
 
                        this.Name = "SearchEditor";
267
 
                        this.Size = new System.Drawing.Size(416, 264);
268
 
                        this.groupBox1.ResumeLayout(false);
269
 
                        this.ResumeLayout(false);
270
 
 
271
 
                }
272
 
                #endregion
273
 
 
274
 
                private void searchButton_Click(object sender, System.EventArgs e)
275
 
                {
276
 
                        SearchExpression searchExpression = (SearchExpression)tNode.Tag;
277
 
 
278
 
                        searchExpression.PropertyName = propertyName.Text;
279
 
                        searchExpression.PropertyType = propertyType.Text;
280
 
                        searchExpression.PropertyValue = propertyValue.Text;
281
 
                        searchExpression.Operation = operation.Text;
282
 
 
283
 
                        tNode.Tag = searchExpression;
284
 
                        
285
 
                        browser.Search( searchExpression );
286
 
                }
287
 
        }
288
 
}