2 // System.Web.UI.WebControls.WebParts.Part
4 // Authors: Chris Toshok <toshok@novell.com>
6 // Copyright (C) 2005 Novell, Inc (http://www.novell.com)
8 // Permission is hereby granted, free of charge, to any person obtaining
9 // a copy of this software and associated documentation files (the
10 // "Software"), to deal in the Software without restriction, including
11 // without limitation the rights to use, copy, modify, merge, publish,
12 // distribute, sublicense, and/or sell copies of the Software, and to
13 // permit persons to whom the Software is furnished to do so, subject to
14 // the following conditions:
16 // The above copyright notice and this permission notice shall be
17 // included in all copies or substantial portions of the Software.
19 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
20 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
22 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
23 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
24 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
25 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
31 namespace System.Web.UI.WebControls.WebParts
33 public abstract class WebPart : Part, IWebPart, IWebActionable
34 #if IWebEditableInterface
49 WebPartVerbCollection verbs;
52 string catalog_icon_url;
56 verbs = new WebPartVerbCollection();
57 allow = Allow.Close | Allow.Connect | Allow.Edit | Allow.Hide | Allow.Minimize | Allow.ZoneChange;
59 catalog_icon_url = "";
62 #if IWebEditableInterface
64 public virtual EditorPartCollection CreateEditorParts ()
66 throw new NotImplementedException ();
71 protected void SetPersonalizationDirty ()
73 throw new NotImplementedException ();
77 public static void SetPersonalizationDirty (Control control)
79 throw new NotImplementedException ();
82 protected override void TrackViewState ()
84 base.TrackViewState();
86 foreach (IStateManager verb in verbs) {
87 verb.TrackViewState();
91 protected internal virtual void OnClosing (EventArgs e)
92 { /* no base class implementation */ }
94 protected internal virtual void OnConnectModeChanged (EventArgs e)
95 { /* no base class implementation */ }
97 protected internal virtual void OnDeleting (EventArgs e)
98 { /* no base class implementation */ }
100 protected internal virtual void OnEditModeChanged (EventArgs e)
101 { /* no base class implementation */ }
103 [WebSysDescriptionAttribute ("")]
104 [WebCategoryAttribute ("Behavior")]
105 public virtual bool AllowClose
108 return (allow & Allow.Close) != 0;
112 allow |= Allow.Close;
114 allow &= ~Allow.Close;
118 [WebSysDescriptionAttribute ("")]
119 [WebCategoryAttribute ("Behavior")]
120 public virtual bool AllowConnect
123 return (allow & Allow.Connect) != 0;
127 allow |= Allow.Connect;
129 allow &= ~Allow.Connect;
133 [WebSysDescriptionAttribute ("")]
134 [WebCategoryAttribute ("Behavior")]
135 public virtual bool AllowEdit
138 return (allow & Allow.Edit) != 0;
144 allow &= ~Allow.Edit;
148 [WebSysDescriptionAttribute ("")]
149 [WebCategoryAttribute ("Behavior")]
150 public virtual bool AllowHide
153 return (allow & Allow.Hide) != 0;
159 allow &= ~Allow.Hide;
163 [WebSysDescriptionAttribute ("")]
164 [WebCategoryAttribute ("Behavior")]
165 public virtual bool AllowMinimize
168 return (allow & Allow.Minimize) != 0;
172 allow |= Allow.Minimize;
174 allow &= ~Allow.Minimize;
178 [WebSysDescriptionAttribute ("")]
179 [WebCategoryAttribute ("Behavior")]
180 public virtual bool AllowZoneChange
183 return (allow & Allow.ZoneChange) != 0;
187 allow |= Allow.ZoneChange;
189 allow &= ~Allow.ZoneChange;
194 public virtual string AuthorizationFilter
205 public virtual string CatalogIconImageUrl
208 return catalog_icon_url;
211 catalog_icon_url = value;
215 [MonoTODO ("why override?")]
216 public override PartChromeState ChromeState
219 return base.ChromeState;
222 base.ChromeState = value;
226 [MonoTODO ("why override?")]
227 public override PartChromeType ChromeType
230 return base.ChromeType;
233 base.ChromeType = value;
238 public string ConnectErrorMessage
245 [MonoTODO ("why override?")]
246 public override string Description
249 return base.Description;
252 base.Description = value;
257 /* msdn2 lists this as an override, but it doesn't appear to work with our implementation */
258 public /*override*/ ContentDirection Direction
261 throw new NotImplementedException ();
264 throw new NotImplementedException ();
268 public string DisplayTitle
276 public virtual WebPartExportMode ExportMode
279 throw new NotImplementedException ();
282 throw new NotImplementedException ();
287 public bool HasSharedData
290 throw new NotImplementedException ();
295 public bool HasUserData
298 throw new NotImplementedException ();
302 [MonoTODO("why override?")]
303 public override Unit Height
314 public virtual WebPartHelpMode HelpMode
317 throw new NotImplementedException ();
320 throw new NotImplementedException ();
325 public virtual string HelpUrl
328 throw new NotImplementedException ();
331 throw new NotImplementedException ();
336 public virtual bool Hidden
339 throw new NotImplementedException ();
342 throw new NotImplementedException ();
346 public virtual string ImportErrorMessage
349 return ViewState.GetString("ImportErrorMessage", "Cannot import this Web Part.");
352 ViewState ["ImportErrorMessage"] = value;
360 throw new NotImplementedException ();
364 [MonoTODO("not virtual and no setter..")]
372 [MonoTODO("not virtual and no setter..")]
373 public bool IsStandalone
384 throw new NotImplementedException ();
389 public virtual string Subtitle
392 throw new NotImplementedException ();
396 [MonoTODO ("why override?")]
397 public override string Title
408 public virtual string TitleIconImageUrl
411 throw new NotImplementedException ();
414 throw new NotImplementedException ();
419 public virtual string TitleUrl
422 throw new NotImplementedException ();
425 throw new NotImplementedException ();
429 public virtual WebPartVerbCollection Verbs
436 #if IWebEditableInterface
438 public virtual object WebBrowsableObject
441 throw new NotImplementedException ();
448 protected WebPartManager WebPartManager
451 throw new NotImplementedException ();
456 [MonoTODO ("why override?")]
457 public override Unit Width
469 public WebPartZoneBase Zone
472 throw new NotImplementedException ();
481 throw new NotImplementedException ();