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.
30 namespace System.Web.UI.WebControls.WebParts
32 public abstract class WebPart : Part, IWebPart, IWebActionable
33 #if IWebEditableInterface
48 WebPartVerbCollection verbs = new WebPartVerbCollection();
51 string catalog_icon_url;
52 WebPartExportMode exportMode = WebPartExportMode.None;
53 string titleIconImageUrl,
56 bool isStatic, hidden, isClosed, hasSharedData, hasUserData;
57 WebPartHelpMode helpMode = WebPartHelpMode.Navigate;
62 verbs = new WebPartVerbCollection();
63 allow = Allow.Close | Allow.Connect | Allow.Edit | Allow.Hide | Allow.Minimize | Allow.ZoneChange;
65 catalog_icon_url = "";
66 titleIconImageUrl = string.Empty;
67 titleUrl = string.Empty;
68 helpUrl = string.Empty;
71 hasSharedData = false;
76 #if IWebEditableInterface
77 [MonoTODO("Not implemented")]
78 public virtual EditorPartCollection CreateEditorParts ()
80 throw new NotImplementedException ();
84 [MonoTODO("Not implemented")]
85 protected void SetPersonalizationDirty ()
87 throw new NotImplementedException ();
90 [MonoTODO("Not implemented")]
91 public static void SetPersonalizationDirty (Control control)
93 throw new NotImplementedException ();
96 protected override void TrackViewState ()
98 base.TrackViewState();
100 foreach (IStateManager verb in verbs) {
101 verb.TrackViewState();
105 internal void SetZoneIndex (int index)
110 protected internal virtual void OnClosing (EventArgs e)
111 { /* no base class implementation */ }
113 protected internal virtual void OnConnectModeChanged (EventArgs e)
114 { /* no base class implementation */ }
116 protected internal virtual void OnDeleting (EventArgs e)
117 { /* no base class implementation */ }
119 protected internal virtual void OnEditModeChanged (EventArgs e)
120 { /* no base class implementation */ }
122 [WebSysDescriptionAttribute ("")]
123 [WebCategoryAttribute ("Behavior")]
124 public virtual bool AllowClose
127 return (allow & Allow.Close) != 0;
131 allow |= Allow.Close;
133 allow &= ~Allow.Close;
137 [WebSysDescriptionAttribute ("")]
138 [WebCategoryAttribute ("Behavior")]
139 public virtual bool AllowConnect
142 return (allow & Allow.Connect) != 0;
146 allow |= Allow.Connect;
148 allow &= ~Allow.Connect;
152 [WebSysDescriptionAttribute ("")]
153 [WebCategoryAttribute ("Behavior")]
154 public virtual bool AllowEdit
157 return (allow & Allow.Edit) != 0;
163 allow &= ~Allow.Edit;
167 [WebSysDescriptionAttribute ("")]
168 [WebCategoryAttribute ("Behavior")]
169 public virtual bool AllowHide
172 return (allow & Allow.Hide) != 0;
178 allow &= ~Allow.Hide;
182 [WebSysDescriptionAttribute ("")]
183 [WebCategoryAttribute ("Behavior")]
184 public virtual bool AllowMinimize
187 return (allow & Allow.Minimize) != 0;
191 allow |= Allow.Minimize;
193 allow &= ~Allow.Minimize;
197 [WebSysDescriptionAttribute ("")]
198 [WebCategoryAttribute ("Behavior")]
199 public virtual bool AllowZoneChange
202 return (allow & Allow.ZoneChange) != 0;
206 allow |= Allow.ZoneChange;
208 allow &= ~Allow.ZoneChange;
212 public virtual string AuthorizationFilter
222 public virtual string CatalogIconImageUrl
225 return catalog_icon_url;
228 catalog_icon_url = value;
232 public override PartChromeState ChromeState
235 return base.ChromeState;
238 base.ChromeState = value;
242 public override PartChromeType ChromeType
245 return base.ChromeType;
248 base.ChromeType = value;
252 [MonoTODO("Not implemented")]
253 public string ConnectErrorMessage
260 public override string Description
263 return base.Description;
266 base.Description = value;
270 [MonoTODO("Not implemented")]
271 /* msdn2 lists this as an override, but it doesn't appear to work with our implementation */
272 public override ContentDirection Direction
275 throw new NotImplementedException ();
278 throw new NotImplementedException ();
282 public string DisplayTitle
289 public virtual WebPartExportMode ExportMode
299 public bool HasSharedData
302 return hasSharedData;
306 public bool HasUserData
313 public override Unit Height
323 public virtual WebPartHelpMode HelpMode
333 public virtual string HelpUrl
343 public virtual bool Hidden
353 public virtual string ImportErrorMessage
356 return ViewState.GetString("ImportErrorMessage", "Cannot import this Web Part.");
359 ViewState ["ImportErrorMessage"] = value;
377 public bool IsStandalone
391 public virtual string Subtitle
398 public override string Title
408 public virtual string TitleIconImageUrl
411 return titleIconImageUrl;
414 titleIconImageUrl = value;
418 public virtual string TitleUrl
428 public virtual WebPartVerbCollection Verbs
435 #if IWebEditableInterface
436 [MonoTODO("Not implemented")]
437 public virtual object WebBrowsableObject
440 throw new NotImplementedException ();
446 [MonoTODO("Not implemented")]
447 protected WebPartManager WebPartManager
450 throw new NotImplementedException ();
455 public override Unit Width
466 [MonoTODO("Not implemented")]
467 public WebPartZoneBase Zone
470 throw new NotImplementedException ();