ChangeLog: Updated ChangeLog.
[mono.git] / mcs / class / System.Web / System.Web.UI.WebControls.WebParts / WebPartVerb.cs
1 //
2 // System.Web.UI.WebControls.WebParts.WebPartVerb.cs
3 //
4 // Authors:
5 //      Sanjay Gupta (gsanjay@novell.com)
6 //
7 // (C) 2004 Novell, Inc (http://www.novell.com)
8 //
9 //
10 // Permission is hereby granted, free of charge, to any person obtaining
11 // a copy of this software and associated documentation files (the
12 // "Software"), to deal in the Software without restriction, including
13 // without limitation the rights to use, copy, modify, merge, publish,
14 // distribute, sublicense, and/or sell copies of the Software, and to
15 // permit persons to whom the Software is furnished to do so, subject to
16 // the following conditions:
17 // 
18 // The above copyright notice and this permission notice shall be
19 // included in all copies or substantial portions of the Software.
20 // 
21 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
22 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
23 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
24 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
25 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
26 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
27 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28 //
29
30 #if NET_2_0
31
32 using System.Web.UI;
33
34 namespace System.Web.UI.WebControls.WebParts
35 {
36         public class WebPartVerb : IStateManager
37         {
38                 private string clientClickHandler;
39                 private WebPartEventHandler serverClickHandler;
40                 private StateBag stateBag;
41                 private bool isChecked = false;
42                 private string description = string.Empty;
43                 private bool enabled = true;
44                 private string imageUrl = string.Empty;
45                 private string text = string.Empty;
46                 private bool visible = true;
47
48                 public WebPartVerb (string clientHandler)
49                 {
50                         this.clientClickHandler = clientHandler;
51                         stateBag = new StateBag ();
52                         stateBag.Add ("clientClickHandler", clientHandler);
53
54                 }
55
56                 public WebPartVerb (WebPartEventHandler serverHandler)
57                 {
58                         this.serverClickHandler = serverHandler;
59                         stateBag = new StateBag ();
60                         stateBag.Add ("serverClickHandler", serverHandler);
61                 }
62
63                 public WebPartVerb (WebPartEventHandler serverHandler, string clientHandler)
64                 {
65                         this.serverClickHandler = serverHandler;
66                         this.clientClickHandler = clientHandler;
67                         stateBag = new StateBag ();
68                         stateBag.Add ("serverClickHandler", serverHandler);
69                         stateBag.Add ("clientClickHandler", clientHandler);
70                 }
71
72                 [MonoTODO]
73                 protected virtual void LoadViewState (object savedState)
74                 {
75                         throw new NotImplementedException ();
76                 }
77
78                 [MonoTODO]
79                 protected virtual object SaveViewState()
80                 {
81                         throw new NotImplementedException ();
82                 }
83
84                 [MonoTODO]
85                 protected virtual void TrackViewState()
86                 {
87                         throw new NotImplementedException();
88                 }
89
90                 [MonoTODO]
91                 void IStateManager.LoadViewState (object savedState)
92                 {
93                         throw new NotImplementedException ();
94                 }
95
96                 [MonoTODO]
97                 object IStateManager.SaveViewState ()
98                 {
99                         throw new NotImplementedException ();
100                 }
101
102                 [MonoTODO]
103                 void IStateManager.TrackViewState ()
104                 {
105                         throw new NotImplementedException ();
106                 }
107
108                 [MonoTODO]
109                 bool IStateManager.get_IsTrackingViewState ()
110                 {
111                         throw new NotImplementedException ();
112                 }
113
114                 public virtual bool Checked {
115                         get { return isChecked; }
116                         set { isChecked = value; }
117                 }
118
119                 public string ClientClickHandler {
120                         get { return clientClickHandler; }
121                 }
122
123                 public virtual string Description {
124                         get { return description; }
125                         set { description = value; }
126                 }
127
128                 public virtual bool Enabled {
129                         get { return enabled; }
130                         set { enabled = value; }
131                 }
132
133                 public string ImageUrl {
134                         get { return imageUrl; }
135                         set { imageUrl = value; }
136                 }
137
138                 protected virtual bool IsTrackingViewState {
139                         get { throw new NotImplementedException (); }
140                 }
141
142                 public WebPartEventHandler ServerClickHandler {
143                         get { return serverClickHandler; }
144                 }
145
146                 public virtual string Text {
147                         get { return text; }
148                         set { text = value; }
149                 }
150
151                 protected StateBag ViewState {
152                         get { return stateBag; }
153                 }
154
155                 public bool Visible {
156                         get { return visible; }
157                         set { visible = value; }
158                 }
159         }
160 }
161 #endif