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 using System
.ComponentModel
;
37 namespace System
.Web
.UI
.WebControls
.WebParts
39 [TypeConverterAttribute ("System.Web.UI.WebControls.WebParts.WebPartVerbConverter, System.Web")]
40 public class WebPartVerb
: IStateManager
42 string clientClickHandler
;
43 WebPartEventHandler serverClickHandler
;
45 bool isChecked
= false;
46 string description
= string.Empty
;
48 string imageUrl
= string.Empty
;
49 string text
= string.Empty
;
57 public WebPartVerb (string id
, string clientHandler
) {
59 this.clientClickHandler
= clientHandler
;
60 stateBag
= new StateBag ();
61 stateBag
.Add ("clientClickHandler", clientHandler
);
65 public WebPartVerb (string id
, WebPartEventHandler serverClickHandler
) {
67 this.serverClickHandler
= serverClickHandler
;
68 stateBag
= new StateBag ();
69 stateBag
.Add ("serverClickHandler", serverClickHandler
);
72 public WebPartVerb (string id
, WebPartEventHandler serverClickHandler
, string clientClickHandler
) {
74 this.serverClickHandler
= serverClickHandler
;
75 this.clientClickHandler
= clientClickHandler
;
76 stateBag
= new StateBag ();
77 stateBag
.Add ("serverClickHandler", serverClickHandler
);
78 stateBag
.Add ("clientClickHandler", clientClickHandler
);
81 [MonoTODO("Not implemented")]
82 protected virtual void LoadViewState (object savedState
)
84 throw new NotImplementedException ();
87 [MonoTODO("Not implemented")]
88 protected virtual object SaveViewState()
90 throw new NotImplementedException ();
93 [MonoTODO("Not implemented")]
94 protected virtual void TrackViewState()
96 throw new NotImplementedException();
99 [MonoTODO("Not implemented")]
100 void IStateManager
.LoadViewState (object savedState
)
102 throw new NotImplementedException ();
105 [MonoTODO("Not implemented")]
106 object IStateManager
.SaveViewState ()
108 throw new NotImplementedException ();
111 [MonoTODO("Not implemented")]
112 void IStateManager
.TrackViewState ()
114 throw new NotImplementedException ();
117 [MonoTODO("Not implemented")]
118 bool IStateManager
.IsTrackingViewState
{
120 throw new NotImplementedException ();
124 [WebSysDescriptionAttribute ("Denotes verb is checked or not."),
125 DefaultValueAttribute (false),
126 NotifyParentPropertyAttribute (true) ]
127 public virtual bool Checked
{
128 get { return isChecked; }
129 set { isChecked = value; }
132 [DesignerSerializationVisibilityAttribute (DesignerSerializationVisibility
.Hidden
),
133 BrowsableAttribute (false)]
134 public string ClientClickHandler
{
135 get { return clientClickHandler; }
138 [LocalizableAttribute (true),
139 WebSysDescriptionAttribute ("Gives descriptive information about the verb"),
140 NotifyParentPropertyAttribute (true)]
141 //WebSysDefaultValueAttribute (string.Empty)]
142 public virtual string Description
{
143 get { return description; }
144 set { description = value; }
147 [NotifyParentPropertyAttribute (true),
148 DefaultValueAttribute (true),
149 WebSysDescriptionAttribute ("Determines whether verb is enabled.")]
150 public virtual bool Enabled
{
151 get { return enabled; }
152 set { enabled = value; }
155 [WebSysDescriptionAttribute ("Denotes URL of the image to be displayed for the verb"),
156 EditorAttribute ("System.Web.UI.Design.ImageUrlEditor, System.Design",
157 "UITypeEditor, System.Drawing"),
158 LocalizableAttribute (true), NotifyParentPropertyAttribute (true)]
159 //UrlPropertyAttribute, DefaultValueAttribute (String.Empty)
160 public string ImageUrl
{
161 get { return imageUrl; }
162 set { imageUrl = value; }
165 protected virtual bool IsTrackingViewState
{
166 get { throw new NotImplementedException (); }
169 [DesignerSerializationVisibilityAttribute (DesignerSerializationVisibility
.Hidden
),
170 BrowsableAttribute (false)]
171 public WebPartEventHandler ServerClickHandler
173 get { return serverClickHandler; }
176 [WebSysDescriptionAttribute ("Denotes text to be displayed for the verb"),
177 LocalizableAttribute (true), NotifyParentPropertyAttribute (true)]
178 //DefaultValueAttribute (String.Empty)
179 public virtual string Text
182 set { text = value; }
185 protected StateBag ViewState
{
186 get { return stateBag; }
189 [DefaultValueAttribute (true),
190 WebSysDescriptionAttribute ("Denotes whether the verb is visible"),
191 LocalizableAttribute (true), NotifyParentPropertyAttribute (true)]
194 get { return visible; }
195 set { visible = value; }