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
79 public virtual EditorPartCollection CreateEditorParts ()
81 throw new NotImplementedException ();
86 protected void SetPersonalizationDirty ()
88 throw new NotImplementedException ();
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 protected internal virtual void OnClosing (EventArgs e)
107 { /* no base class implementation */ }
109 protected internal virtual void OnConnectModeChanged (EventArgs e)
110 { /* no base class implementation */ }
112 protected internal virtual void OnDeleting (EventArgs e)
113 { /* no base class implementation */ }
115 protected internal virtual void OnEditModeChanged (EventArgs e)
116 { /* no base class implementation */ }
118 [WebSysDescriptionAttribute ("")]
119 [WebCategoryAttribute ("Behavior")]
120 public virtual bool AllowClose
123 return (allow & Allow.Close) != 0;
127 allow |= Allow.Close;
129 allow &= ~Allow.Close;
133 [WebSysDescriptionAttribute ("")]
134 [WebCategoryAttribute ("Behavior")]
135 public virtual bool AllowConnect
138 return (allow & Allow.Connect) != 0;
142 allow |= Allow.Connect;
144 allow &= ~Allow.Connect;
148 [WebSysDescriptionAttribute ("")]
149 [WebCategoryAttribute ("Behavior")]
150 public virtual bool AllowEdit
153 return (allow & Allow.Edit) != 0;
159 allow &= ~Allow.Edit;
163 [WebSysDescriptionAttribute ("")]
164 [WebCategoryAttribute ("Behavior")]
165 public virtual bool AllowHide
168 return (allow & Allow.Hide) != 0;
174 allow &= ~Allow.Hide;
178 [WebSysDescriptionAttribute ("")]
179 [WebCategoryAttribute ("Behavior")]
180 public virtual bool AllowMinimize
183 return (allow & Allow.Minimize) != 0;
187 allow |= Allow.Minimize;
189 allow &= ~Allow.Minimize;
193 [WebSysDescriptionAttribute ("")]
194 [WebCategoryAttribute ("Behavior")]
195 public virtual bool AllowZoneChange
198 return (allow & Allow.ZoneChange) != 0;
202 allow |= Allow.ZoneChange;
204 allow &= ~Allow.ZoneChange;
209 public virtual string AuthorizationFilter
220 public virtual string CatalogIconImageUrl
223 return catalog_icon_url;
226 catalog_icon_url = value;
230 [MonoTODO ("why override?")]
231 public override PartChromeState ChromeState
234 return base.ChromeState;
237 base.ChromeState = value;
241 [MonoTODO ("why override?")]
242 public override PartChromeType ChromeType
245 return base.ChromeType;
248 base.ChromeType = value;
253 public string ConnectErrorMessage
260 [MonoTODO ("why override?")]
261 public override string Description
264 return base.Description;
267 base.Description = value;
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
291 public virtual WebPartExportMode ExportMode
302 public bool HasSharedData
305 return hasSharedData;
310 public bool HasUserData
317 [MonoTODO("why override?")]
318 public override Unit Height
329 public virtual WebPartHelpMode HelpMode
340 public virtual string HelpUrl
351 public virtual bool Hidden
361 public virtual string ImportErrorMessage
364 return ViewState.GetString("ImportErrorMessage", "Cannot import this Web Part.");
367 ViewState ["ImportErrorMessage"] = value;
379 [MonoTODO("not virtual and no setter..")]
387 [MonoTODO("not virtual and no setter..")]
388 public bool IsStandalone
404 public virtual string Subtitle
411 [MonoTODO ("why override?")]
412 public override string Title
423 public virtual string TitleIconImageUrl
426 return titleIconImageUrl;
429 titleIconImageUrl = value;
434 public virtual string TitleUrl
444 public virtual WebPartVerbCollection Verbs
451 #if IWebEditableInterface
453 public virtual object WebBrowsableObject
456 throw new NotImplementedException ();
463 protected WebPartManager WebPartManager
466 throw new NotImplementedException ();
471 [MonoTODO ("why override?")]
472 public override Unit Width
484 public WebPartZoneBase Zone
487 throw new NotImplementedException ();