2 // System.Web.UI.WebControls.WebParts.WebPartVerb.cs
5 // Sanjay Gupta (gsanjay@novell.com)
7 // (C) 2004 Novell, Inc (http://www.novell.com)
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:
18 // The above copyright notice and this permission notice shall be
19 // included in all copies or substantial portions of the Software.
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.
34 namespace System.Web.UI.WebControls.WebParts
36 public class WebPartVerb : IStateManager
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;
48 public WebPartVerb (string clientHandler)
50 this.clientClickHandler = clientHandler;
51 stateBag = new StateBag ();
52 stateBag.Add ("clientClickHandler", clientHandler);
56 public WebPartVerb (WebPartEventHandler serverHandler)
58 this.serverClickHandler = serverHandler;
59 stateBag = new StateBag ();
60 stateBag.Add ("serverClickHandler", serverHandler);
63 public WebPartVerb (WebPartEventHandler serverHandler, string clientHandler)
65 this.serverClickHandler = serverHandler;
66 this.clientClickHandler = clientHandler;
67 stateBag = new StateBag ();
68 stateBag.Add ("serverClickHandler", serverHandler);
69 stateBag.Add ("clientClickHandler", clientHandler);
73 protected virtual void LoadViewState (object savedState)
75 throw new NotImplementedException ();
79 protected virtual object SaveViewState()
81 throw new NotImplementedException ();
85 protected virtual void TrackViewState()
87 throw new NotImplementedException();
91 void IStateManager.LoadViewState (object savedState)
93 throw new NotImplementedException ();
97 object IStateManager.SaveViewState ()
99 throw new NotImplementedException ();
103 void IStateManager.TrackViewState ()
105 throw new NotImplementedException ();
109 bool IStateManager.get_IsTrackingViewState ()
111 throw new NotImplementedException ();
114 public virtual bool Checked {
115 get { return isChecked; }
116 set { isChecked = value; }
119 public string ClientClickHandler {
120 get { return clientClickHandler; }
123 public virtual string Description {
124 get { return description; }
125 set { description = value; }
128 public virtual bool Enabled {
129 get { return enabled; }
130 set { enabled = value; }
133 public string ImageUrl {
134 get { return imageUrl; }
135 set { imageUrl = value; }
138 protected virtual bool IsTrackingViewState {
139 get { throw new NotImplementedException (); }
142 public WebPartEventHandler ServerClickHandler {
143 get { return serverClickHandler; }
146 public virtual string Text {
148 set { text = value; }
151 protected StateBag ViewState {
152 get { return stateBag; }
155 public bool Visible {
156 get { return visible; }
157 set { visible = value; }