2
using System.Collections;
3
using System.ComponentModel;
6
using System.Windows.Forms;
11
/// Summary description for SearchEditor.
13
public class SearchEditor : System.Windows.Forms.UserControl
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;
31
/// Required designer variable.
33
private System.ComponentModel.Container components = null;
37
// This call is required by the Windows.Forms Form Designer.
38
InitializeComponent();
42
public Button SearchButton
50
public IStoreBrowser Browser
58
public TreeNode SearchNode
64
SearchExpression search = (SearchExpression)tNode.Tag;
65
if ( search != null && search.Target != null )
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;
75
target.Text = "Store";
77
propertyName.Text = search.PropertyName;
78
propertyType.Text = search.PropertyType;
79
propertyValue.Text = search.PropertyValue;
80
operation.Text = search.Operation;
87
/// Clean up any resources being used.
89
protected override void Dispose( bool disposing )
93
if(components != null)
98
base.Dispose( disposing );
101
#region Component Designer generated code
103
/// Required method for Designer support - do not modify
104
/// the contents of this method with the code editor.
106
private void InitializeComponent()
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();
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 = "";
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 = "";
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:";
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";
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 = "";
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:";
181
this.propertyType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
182
this.propertyType.Items.AddRange(new object[] {
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;
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:";
215
this.operation.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
216
this.operation.Items.AddRange(new object[] {
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;
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:";
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:";
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);
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);
274
private void searchButton_Click(object sender, System.EventArgs e)
276
SearchExpression searchExpression = (SearchExpression)tNode.Tag;
278
searchExpression.PropertyName = propertyName.Text;
279
searchExpression.PropertyType = propertyType.Text;
280
searchExpression.PropertyValue = propertyValue.Text;
281
searchExpression.Operation = operation.Text;
283
tNode.Tag = searchExpression;
285
browser.Search( searchExpression );