Applying patch from Jonathon Rossi
[castle.git] / Experiments / MVC / Castle.MVC / Views / WinFormView.cs
blob55cd3575e2e1a9341946d075cc95fb212f043bad
1 #region Apache Notice
2 /*****************************************************************************
3 *
4 * Castle.MVC
5 *
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
18 ********************************************************************************/
19 #endregion
21 #region Autors
23 /************************************************
24 * Gilles Bayon
25 *************************************************/
26 #endregion
28 using System;
29 using System.Reflection;
30 using System.Windows.Forms;
31 using Castle.MVC.Configuration;
32 using Castle.MVC.Controllers;
33 using Castle.MVC.StatePersister;
34 using Castle.MVC.States;
35 using Castle.Windsor;
37 namespace Castle.MVC.Views
39 /// <summary>
40 /// Base class for user interaction in windows application. You can inherit from
41 /// this class when developing your windows forms.
42 /// </summary>
43 public class WinFormView : Form, IView
45 private IState _state = null;
47 /// <summary>
48 /// Constructor
49 /// </summary>
50 public WinFormView()
52 this.Load += new EventHandler(WinFormViewOnLoad);
55 private void WinFormViewOnLoad( object source, EventArgs e )
57 //To Do
60 #region IView members
62 /// <summary>
63 /// Gets the current view name.
64 /// </summary>
65 public string View
67 get { return _state.CurrentView; }
70 /// <summary>
71 /// Gets access to the user process state.
72 /// </summary>
73 public IState State
75 get { return _state; }
78 #endregion