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 = new WebPartVerbCollection();
52 string catalog_icon_url;
53 WebPartExportMode exportMode = WebPartExportMode.None;
54 string titleIconImageUrl,
57 bool isStatic, hidden, isClosed, hasSharedData, hasUserData;
58 WebPartHelpMode helpMode = WebPartHelpMode.Navigate;
63 verbs = new WebPartVerbCollection();
64 allow = Allow.Close | Allow.Connect | Allow.Edit | Allow.Hide | Allow.Minimize | Allow.ZoneChange;
66 catalog_icon_url = "";
67 titleIconImageUrl = string.Empty;
68 titleUrl = string.Empty;
69 helpUrl = string.Empty;
72 hasSharedData = false;
77 #if IWebEditableInterface
78 [MonoTODO("Not implemented")]
79 public virtual EditorPartCollection CreateEditorParts ()
81 throw new NotImplementedException ();
85 [MonoTODO("Not implemented")]
86 protected void SetPersonalizationDirty ()
88 throw new NotImplementedException ();
91 [MonoTODO("Not implemented")]
92 public static void SetPersonalizationDirty (Control control)
94 throw new NotImplementedException ();
97 protected override void TrackViewState ()
99 base.TrackViewState();
101 foreach (IStateManager verb in verbs) {
102 verb.TrackViewState();
106 internal void SetZoneIndex (int index)
111 protected internal virtual void OnClosing (EventArgs e)
112 { /* no base class implementation */ }
114 protected internal virtual void OnConnectModeChanged (EventArgs e)
115 { /* no base class implementation */ }
117 protected internal virtual void OnDeleting (EventArgs e)
118 { /* no base class implementation */ }
120 protected internal virtual void OnEditModeChanged (EventArgs e)
121 { /* no base class implementation */ }
123 [WebSysDescriptionAttribute ("")]
124 [WebCategoryAttribute ("Behavior")]
125 public virtual bool AllowClose
128 return (allow & Allow.Close) != 0;
132 allow |= Allow.Close;
134 allow &= ~Allow.Close;
138 [WebSysDescriptionAttribute ("")]
139 [WebCategoryAttribute ("Behavior")]
140 public virtual bool AllowConnect
143 return (allow & Allow.Connect) != 0;
147 allow |= Allow.Connect;
149 allow &= ~Allow.Connect;
153 [WebSysDescriptionAttribute ("")]
154 [WebCategoryAttribute ("Behavior")]
155 public virtual bool AllowEdit
158 return (allow & Allow.Edit) != 0;
164 allow &= ~Allow.Edit;
168 [WebSysDescriptionAttribute ("")]
169 [WebCategoryAttribute ("Behavior")]
170 public virtual bool AllowHide
173 return (allow & Allow.Hide) != 0;
179 allow &= ~Allow.Hide;
183 [WebSysDescriptionAttribute ("")]
184 [WebCategoryAttribute ("Behavior")]
185 public virtual bool AllowMinimize
188 return (allow & Allow.Minimize) != 0;
192 allow |= Allow.Minimize;
194 allow &= ~Allow.Minimize;
198 [WebSysDescriptionAttribute ("")]
199 [WebCategoryAttribute ("Behavior")]
200 public virtual bool AllowZoneChange
203 return (allow & Allow.ZoneChange) != 0;
207 allow |= Allow.ZoneChange;
209 allow &= ~Allow.ZoneChange;
213 public virtual string AuthorizationFilter
223 public virtual string CatalogIconImageUrl
226 return catalog_icon_url;
229 catalog_icon_url = value;
233 public override PartChromeState ChromeState
236 return base.ChromeState;
239 base.ChromeState = value;
243 public override PartChromeType ChromeType
246 return base.ChromeType;
249 base.ChromeType = value;
253 [MonoTODO("Not implemented")]
254 public string ConnectErrorMessage
261 public override string Description
264 return base.Description;
267 base.Description = value;
271 [MonoTODO("Not implemented")]
272 /* msdn2 lists this as an override, but it doesn't appear to work with our implementation */
273 public override ContentDirection Direction
276 throw new NotImplementedException ();
279 throw new NotImplementedException ();
283 public string DisplayTitle
290 public virtual WebPartExportMode ExportMode
300 public bool HasSharedData
303 return hasSharedData;
307 public bool HasUserData
314 public override Unit Height
324 public virtual WebPartHelpMode HelpMode
334 public virtual string HelpUrl
344 public virtual bool Hidden
354 public virtual string ImportErrorMessage
357 return ViewState.GetString("ImportErrorMessage", "Cannot import this Web Part.");
360 ViewState ["ImportErrorMessage"] = value;
378 public bool IsStandalone
392 public virtual string Subtitle
399 public override string Title
409 public virtual string TitleIconImageUrl
412 return titleIconImageUrl;
415 titleIconImageUrl = value;
419 public virtual string TitleUrl
429 public virtual WebPartVerbCollection Verbs
436 #if IWebEditableInterface
437 [MonoTODO("Not implemented")]
438 public virtual object WebBrowsableObject
441 throw new NotImplementedException ();
447 [MonoTODO("Not implemented")]
448 protected WebPartManager WebPartManager
451 throw new NotImplementedException ();
456 public override Unit Width
467 [MonoTODO("Not implemented")]
468 public WebPartZoneBase Zone
471 throw new NotImplementedException ();