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 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
);
77 protected virtual void LoadViewState (object savedState
)
79 throw new NotImplementedException ();
83 protected virtual object SaveViewState()
85 throw new NotImplementedException ();
89 protected virtual void TrackViewState()
91 throw new NotImplementedException();
95 void IStateManager
.LoadViewState (object savedState
)
97 throw new NotImplementedException ();
101 object IStateManager
.SaveViewState ()
103 throw new NotImplementedException ();
107 void IStateManager
.TrackViewState ()
109 throw new NotImplementedException ();
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
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)]
188 get { return visible; }
189 set { visible = value; }