1 // Copyright 2004-2008 Castle Project - http://www.castleproject.org/
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
7 // http://www.apache.org/licenses/LICENSE-2.0
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
15 namespace GettingStartedPart1
19 using System
.Collections
;
20 using System
.ComponentModel
;
21 using System
.Windows
.Forms
;
24 public class Form1
: System
.Windows
.Forms
.Form
26 private readonly HttpServiceWatcher serviceWatcher
;
27 private System
.Windows
.Forms
.Button button1
;
28 private System
.Windows
.Forms
.Button button2
;
29 private System
.ComponentModel
.Container components
= null;
33 InitializeComponent();
36 public Form1(HttpServiceWatcher serviceWatcher
) : this()
38 this.serviceWatcher
= serviceWatcher
;
42 /// Clean up any resources being used.
44 protected override void Dispose( bool disposing
)
48 if (components
!= null)
53 base.Dispose( disposing
);
56 #region Windows Form Designer generated code
58 /// Required method for Designer support - do not modify
59 /// the contents of this method with the code editor.
61 private void InitializeComponent()
63 this.button1
= new System
.Windows
.Forms
.Button();
64 this.button2
= new System
.Windows
.Forms
.Button();
69 this.button1
.Location
= new System
.Drawing
.Point(171, 112);
70 this.button1
.Name
= "button1";
71 this.button1
.TabIndex
= 0;
72 this.button1
.Text
= "Start";
73 this.button1
.Click
+= new System
.EventHandler(this.button1_Click
);
77 this.button2
.Location
= new System
.Drawing
.Point(171, 160);
78 this.button2
.Name
= "button2";
79 this.button2
.TabIndex
= 1;
80 this.button2
.Text
= "Stop";
84 this.AutoScaleBaseSize
= new System
.Drawing
.Size(5, 13);
85 this.ClientSize
= new System
.Drawing
.Size(416, 294);
86 this.Controls
.Add(this.button2
);
87 this.Controls
.Add(this.button1
);
90 this.ResumeLayout(false);
95 private void button1_Click(object sender
, System
.EventArgs e
)
97 serviceWatcher
.StartWatching();
98 serviceWatcher
.StopWatching();
102 /// The main entry point for the application.
105 // static void Main()
107 // Application.Run(new Form1());