Fixing an issue with output parameters that are of type IntPtr
[castle.git] / Samples / InversionOfControl / GettingStarted / GettingStartedPart1 / Form1.cs
blob62ecec2f5c11522696c8c562485a69c32297ad26
1 // Copyright 2004-2008 Castle Project - http://www.castleproject.org/
2 //
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
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
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
17 using System;
18 using System.Drawing;
19 using System.Collections;
20 using System.ComponentModel;
21 using System.Windows.Forms;
22 using System.Data;
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;
31 public Form1()
33 InitializeComponent();
36 public Form1(HttpServiceWatcher serviceWatcher) : this()
38 this.serviceWatcher = serviceWatcher;
41 /// <summary>
42 /// Clean up any resources being used.
43 /// </summary>
44 protected override void Dispose( bool disposing )
46 if( disposing )
48 if (components != null)
50 components.Dispose();
53 base.Dispose( disposing );
56 #region Windows Form Designer generated code
57 /// <summary>
58 /// Required method for Designer support - do not modify
59 /// the contents of this method with the code editor.
60 /// </summary>
61 private void InitializeComponent()
63 this.button1 = new System.Windows.Forms.Button();
64 this.button2 = new System.Windows.Forms.Button();
65 this.SuspendLayout();
66 //
67 // button1
68 //
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);
74 //
75 // button2
76 //
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";
81 //
82 // Form1
83 //
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);
88 this.Name = "Form1";
89 this.Text = "Form1";
90 this.ResumeLayout(false);
93 #endregion
95 private void button1_Click(object sender, System.EventArgs e)
97 serviceWatcher.StartWatching();
98 serviceWatcher.StopWatching();
101 /// <summary>
102 /// The main entry point for the application.
103 /// </summary>
104 // [STAThread]
105 // static void Main()
106 // {
107 // Application.Run(new Form1());
108 // }