**** Merged from MCS ****
[mono-project.git] / mcs / class / System.Web / System.Web.UI.WebControls.WebParts / WebPartVerb.cs
blob174c58edfdd329da37da8d92b2325a786a76f208
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.
30 #if NET_2_0
32 using System.Web;
33 using System.Web.UI;
34 using System.ComponentModel;
35 using System;
37 namespace System.Web.UI.WebControls.WebParts
39 [TypeConverterAttribute ("System.Web.UI.WebControls.WebParts.WebPartVerbConverter, System.Web")]
40 public class WebPartVerb : IStateManager
42 private string clientClickHandler;
43 private WebPartEventHandler serverClickHandler;
44 private StateBag stateBag;
45 private bool isChecked = false;
46 private string description = string.Empty;
47 private bool enabled = true;
48 private string imageUrl = string.Empty;
49 private string text = string.Empty;
50 private bool visible = true;
52 public WebPartVerb (string clientHandler)
54 this.clientClickHandler = clientHandler;
55 stateBag = new StateBag ();
56 stateBag.Add ("clientClickHandler", clientHandler);
60 public WebPartVerb (WebPartEventHandler serverHandler)
62 this.serverClickHandler = serverHandler;
63 stateBag = new StateBag ();
64 stateBag.Add ("serverClickHandler", serverHandler);
67 public WebPartVerb (WebPartEventHandler serverHandler, string clientHandler)
69 this.serverClickHandler = serverHandler;
70 this.clientClickHandler = clientHandler;
71 stateBag = new StateBag ();
72 stateBag.Add ("serverClickHandler", serverHandler);
73 stateBag.Add ("clientClickHandler", clientHandler);
76 [MonoTODO]
77 protected virtual void LoadViewState (object savedState)
79 throw new NotImplementedException ();
82 [MonoTODO]
83 protected virtual object SaveViewState()
85 throw new NotImplementedException ();
88 [MonoTODO]
89 protected virtual void TrackViewState()
91 throw new NotImplementedException();
94 [MonoTODO]
95 void IStateManager.LoadViewState (object savedState)
97 throw new NotImplementedException ();
100 [MonoTODO]
101 object IStateManager.SaveViewState ()
103 throw new NotImplementedException ();
106 [MonoTODO]
107 void IStateManager.TrackViewState ()
109 throw new NotImplementedException ();
112 [MonoTODO]
113 bool IStateManager.get_IsTrackingViewState ()
115 throw new NotImplementedException ();
118 [WebSysDescriptionAttribute ("Denotes verb is checked or not."),
119 DefaultValueAttribute (false),
120 NotifyParentPropertyAttribute (true) ]
121 public virtual bool Checked {
122 get { return isChecked; }
123 set { isChecked = value; }
126 [DesignerSerializationVisibilityAttribute (DesignerSerializationVisibility.Hidden),
127 BrowsableAttribute (false)]
128 public string ClientClickHandler {
129 get { return clientClickHandler; }
132 [LocalizableAttribute (true),
133 WebSysDescriptionAttribute ("Gives descriptive information about the verb"),
134 NotifyParentPropertyAttribute (true)]
135 //WebSysDefaultValueAttribute (string.Empty)]
136 public virtual string Description {
137 get { return description; }
138 set { description = value; }
141 [NotifyParentPropertyAttribute (true),
142 DefaultValueAttribute (true),
143 WebSysDescriptionAttribute ("Determines whether verb is enabled.")]
144 public virtual bool Enabled {
145 get { return enabled; }
146 set { enabled = value; }
149 [WebSysDescriptionAttribute ("Denotes URL of the image to be displayed for the verb"),
150 EditorAttribute ("System.Web.UI.Design.ImageUrlEditor, System.Design",
151 "System.Drawing.Design.UITypeEditor, System.Drawing"),
152 LocalizableAttribute (true), NotifyParentPropertyAttribute (true)]
153 //UrlPropertyAttribute, DefaultValueAttribute (String.Empty)
154 public string ImageUrl {
155 get { return imageUrl; }
156 set { imageUrl = value; }
159 protected virtual bool IsTrackingViewState {
160 get { throw new NotImplementedException (); }
163 [DesignerSerializationVisibilityAttribute (DesignerSerializationVisibility.Hidden),
164 BrowsableAttribute (false)]
165 public WebPartEventHandler ServerClickHandler
167 get { return serverClickHandler; }
170 [WebSysDescriptionAttribute ("Denotes text to be displayed for the verb"),
171 LocalizableAttribute (true), NotifyParentPropertyAttribute (true)]
172 //DefaultValueAttribute (String.Empty)
173 public virtual string Text
175 get { return text; }
176 set { text = value; }
179 protected StateBag ViewState {
180 get { return stateBag; }
183 [DefaultValueAttribute (true),
184 WebSysDescriptionAttribute ("Denotes whether the verb is visible"),
185 LocalizableAttribute (true), NotifyParentPropertyAttribute (true)]
186 public bool Visible
188 get { return visible; }
189 set { visible = value; }
193 #endif