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 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;
208 public virtual string AuthorizationFilter
218 public virtual string CatalogIconImageUrl
221 return catalog_icon_url;
224 catalog_icon_url = value;
228 public override PartChromeState ChromeState
231 return base.ChromeState;
234 base.ChromeState = value;
238 public override PartChromeType ChromeType
241 return base.ChromeType;
244 base.ChromeType = value;
248 [MonoTODO("Not implemented")]
249 public string ConnectErrorMessage
256 public override string Description
259 return base.Description;
262 base.Description = value;
266 [MonoTODO("Not implemented")]
267 /* msdn2 lists this as an override, but it doesn't appear to work with our implementation */
268 public override ContentDirection Direction
271 throw new NotImplementedException ();
274 throw new NotImplementedException ();
278 public string DisplayTitle
285 public virtual WebPartExportMode ExportMode
295 public bool HasSharedData
298 return hasSharedData;
302 public bool HasUserData
309 public override Unit Height
319 public virtual WebPartHelpMode HelpMode
329 public virtual string HelpUrl
339 public virtual bool Hidden
349 public virtual string ImportErrorMessage
352 return ViewState.GetString("ImportErrorMessage", "Cannot import this Web Part.");
355 ViewState ["ImportErrorMessage"] = value;
373 public bool IsStandalone
387 public virtual string Subtitle
394 public override string Title
404 public virtual string TitleIconImageUrl
407 return titleIconImageUrl;
410 titleIconImageUrl = value;
414 public virtual string TitleUrl
424 public virtual WebPartVerbCollection Verbs
431 #if IWebEditableInterface
432 [MonoTODO("Not implemented")]
433 public virtual object WebBrowsableObject
436 throw new NotImplementedException ();
442 [MonoTODO("Not implemented")]
443 protected WebPartManager WebPartManager
446 throw new NotImplementedException ();
451 public override Unit Width
462 [MonoTODO("Not implemented")]
463 public WebPartZoneBase Zone
466 throw new NotImplementedException ();