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.
33 using System.ComponentModel;
36 namespace System.Web.UI.WebControls.WebParts
38 [TypeConverterAttribute ("System.Web.UI.WebControls.WebParts.WebPartVerbConverter, System.Web")]
39 public class WebPartVerb : IStateManager
41 string clientClickHandler;
42 WebPartEventHandler serverClickHandler;
44 bool isChecked = false;
45 string description = string.Empty;
47 string imageUrl = string.Empty;
48 string text = string.Empty;
56 public WebPartVerb (string id, string clientHandler) {
58 this.clientClickHandler = clientHandler;
59 stateBag = new StateBag ();
60 stateBag.Add ("clientClickHandler", clientHandler);
64 public WebPartVerb (string id, WebPartEventHandler serverClickHandler) {
66 this.serverClickHandler = serverClickHandler;
67 stateBag = new StateBag ();
68 stateBag.Add ("serverClickHandler", serverClickHandler);
71 public WebPartVerb (string id, WebPartEventHandler serverClickHandler, string clientClickHandler) {
73 this.serverClickHandler = serverClickHandler;
74 this.clientClickHandler = clientClickHandler;
75 stateBag = new StateBag ();
76 stateBag.Add ("serverClickHandler", serverClickHandler);
77 stateBag.Add ("clientClickHandler", clientClickHandler);
80 [MonoTODO("Not implemented")]
81 protected virtual void LoadViewState (object savedState)
83 throw new NotImplementedException ();
86 [MonoTODO("Not implemented")]
87 protected virtual object SaveViewState()
89 throw new NotImplementedException ();
92 [MonoTODO("Not implemented")]
93 protected virtual void TrackViewState()
95 throw new NotImplementedException();
98 [MonoTODO("Not implemented")]
99 void IStateManager.LoadViewState (object savedState)
101 throw new NotImplementedException ();
104 [MonoTODO("Not implemented")]
105 object IStateManager.SaveViewState ()
107 throw new NotImplementedException ();
110 [MonoTODO("Not implemented")]
111 void IStateManager.TrackViewState ()
113 throw new NotImplementedException ();
116 [MonoTODO("Not implemented")]
117 bool IStateManager.IsTrackingViewState {
119 throw new NotImplementedException ();
123 [WebSysDescriptionAttribute ("Denotes verb is checked or not."),
124 DefaultValueAttribute (false),
125 NotifyParentPropertyAttribute (true) ]
126 public virtual bool Checked {
127 get { return isChecked; }
128 set { isChecked = value; }
131 [DesignerSerializationVisibilityAttribute (DesignerSerializationVisibility.Hidden),
132 BrowsableAttribute (false)]
133 public string ClientClickHandler {
134 get { return clientClickHandler; }
137 [LocalizableAttribute (true),
138 WebSysDescriptionAttribute ("Gives descriptive information about the verb"),
139 NotifyParentPropertyAttribute (true)]
140 //WebSysDefaultValueAttribute (string.Empty)]
141 public virtual string Description {
142 get { return description; }
143 set { description = value; }
146 [NotifyParentPropertyAttribute (true),
147 DefaultValueAttribute (true),
148 WebSysDescriptionAttribute ("Determines whether verb is enabled.")]
149 public virtual bool Enabled {
150 get { return enabled; }
151 set { enabled = value; }
154 [WebSysDescriptionAttribute ("Denotes URL of the image to be displayed for the verb"),
155 EditorAttribute ("System.Web.UI.Design.ImageUrlEditor, System.Design",
156 "UITypeEditor, System.Drawing"),
157 LocalizableAttribute (true), NotifyParentPropertyAttribute (true)]
158 //UrlPropertyAttribute, DefaultValueAttribute (String.Empty)
159 public string ImageUrl {
160 get { return imageUrl; }
161 set { imageUrl = value; }
164 protected virtual bool IsTrackingViewState {
165 get { throw new NotImplementedException (); }
168 [DesignerSerializationVisibilityAttribute (DesignerSerializationVisibility.Hidden),
169 BrowsableAttribute (false)]
170 public WebPartEventHandler ServerClickHandler
172 get { return serverClickHandler; }
175 [WebSysDescriptionAttribute ("Denotes text to be displayed for the verb"),
176 LocalizableAttribute (true), NotifyParentPropertyAttribute (true)]
177 //DefaultValueAttribute (String.Empty)
178 public virtual string Text
181 set { text = value; }
184 protected StateBag ViewState {
185 get { return stateBag; }
188 [DefaultValueAttribute (true),
189 WebSysDescriptionAttribute ("Denotes whether the verb is visible"),
190 LocalizableAttribute (true), NotifyParentPropertyAttribute (true)]
193 get { return visible; }
194 set { visible = value; }