Author: dimitar
Date: 2006-08-10 07:17:16 -0400 (Thu, 10 Aug 2006)
New Revision: 63579
Modified:
trunk/mcs/class/System.Web/System.Web.UI.WebControls.WebParts/ConnectionPoint.cs
trunk/mcs/class/System.Web/System.Web.UI.WebControls.WebParts/EditorPart.cs
trunk/mcs/class/System.Web/System.Web.UI.WebControls.WebParts/Part.cs
trunk/mcs/class/System.Web/System.Web.UI.WebControls.WebParts/WebPart.cs
trunk/mcs/class/System.Web/System.Web.UI.WebControls.WebParts/WebPartConnectionsEventArgs.cs
trunk/mcs/class/System.Web/System.Web.UI.WebControls.WebParts/WebPartDisplayMode.cs
trunk/mcs/class/System.Web/System.Web.UI.WebControls.WebParts/WebPartVerb.cs
Log:
*EditorPart.cs: implementation added
*Part.cs: implementation of Controls
*WebPartConnectionEventArgs.cs: replaced Connection with WebPartConnection
*WebPartDisplayMode.cs: added behavior according to documentation
*WebPartVerb.cs: update constructors according to documentation
*WebPart.cs added implementation for properties
*ConnectionPoint.cs added CallbackMethod
Modified:
trunk/mcs/class/System.Web/System.Web.UI.WebControls.WebParts/ConnectionPoint.cs
===================================================================
---
trunk/mcs/class/System.Web/System.Web.UI.WebControls.WebParts/ConnectionPoint.cs
2006-08-10 10:35:01 UTC (rev 63578)
+++
trunk/mcs/class/System.Web/System.Web.UI.WebControls.WebParts/ConnectionPoint.cs
2006-08-10 11:17:16 UTC (rev 63579)
@@ -53,6 +53,10 @@
this.callBackMethod = callBack;
}
+ internal MethodInfo CallbackMethod {
+ get{ return callBackMethod; }
+ }
+
[MonoTODO]
public virtual bool GetEnabled (Control control)
{
@@ -80,4 +84,4 @@
}
}
}
-#endif
\ No newline at end of file
+#endif
Modified:
trunk/mcs/class/System.Web/System.Web.UI.WebControls.WebParts/EditorPart.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI.WebControls.WebParts/EditorPart.cs
2006-08-10 10:35:01 UTC (rev 63578)
+++ trunk/mcs/class/System.Web/System.Web.UI.WebControls.WebParts/EditorPart.cs
2006-08-10 11:17:16 UTC (rev 63579)
@@ -1,4 +1,4 @@
-//
+//
// System.Web.UI.WebControls.WebParts.EditorPart.cs
//
// Authors:
@@ -38,7 +38,16 @@
[BindableAttribute(false)]
[Designer
("System.Web.UI.Design.WebControls.WebParts.EditorPartDesigner, " +
Consts.AssemblySystem_Design, "System.ComponentModel.Design.IDesigner")]
public abstract class EditorPart : Part
- {
+ {
+ bool display = true;
+ WebPart webPartToEdit;
+ WebPartManager manager;
+ EditorZoneBase zone;
+ string displayTitle;
+
+
+ protected EditorPart() {}
+
public abstract bool ApplyChanges ();
protected override IDictionary GetDesignModeState ()
@@ -48,12 +57,19 @@
protected internal override void OnPreRender (EventArgs e)
{
- throw new NotImplementedException ();
+ if(zone == null)
+ throw new InvalidOperationException();
+ base.OnPreRender(e);
+ if(!Display)
+ Visible = false;
}
+ [MonoTODO]
protected override void SetDesignModeState (IDictionary data)
{
- throw new NotImplementedException ();
+ EditorZoneBase stateZone = data["Zone"] as
EditorZoneBase;
+ if(stateZone != null)
+ zone = stateZone;
}
public abstract void SyncChanges ();
@@ -61,13 +77,15 @@
[Browsable (false)]
[DesignerSerializationVisibility
(DesignerSerializationVisibility.Hidden)]
public virtual bool Display {
- get { throw new NotImplementedException (); }
+ get {
+ return display;
+ }
}
[Browsable (false)]
[DesignerSerializationVisibility
(DesignerSerializationVisibility.Hidden)]
public string DisplayTitle {
- get { throw new NotImplementedException (); }
+ get { return displayTitle; }
}
#if false
@@ -77,9 +95,17 @@
#endif
protected WebPart WebPartToEdit {
- get { throw new NotImplementedException (); }
+ get { return webPartToEdit; }
}
+ protected WebPartManager WebPartManager {
+ get { return manager; }
+ }
+
+ protected EditorZoneBase Zone {
+ get { return zone; }
+ }
+
#if false
protected EditorZoneBase Zone {
get { throw new NotImplementedException (); }
Modified: trunk/mcs/class/System.Web/System.Web.UI.WebControls.WebParts/Part.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI.WebControls.WebParts/Part.cs
2006-08-10 10:35:01 UTC (rev 63578)
+++ trunk/mcs/class/System.Web/System.Web.UI.WebControls.WebParts/Part.cs
2006-08-10 11:17:16 UTC (rev 63579)
@@ -37,6 +37,7 @@
string title;
PartChromeState chrome_state;
PartChromeType chrome_type;
+ ControlCollection controls;
internal Part ()
{
@@ -84,7 +85,9 @@
public virtual new ControlCollection Controls
{
get {
- throw new NotImplementedException ();
+ if(controls == null)
+ controls = new ControlCollection(this);
+ return controls;
}
}
@@ -107,8 +110,6 @@
title = value;
}
}
-
}
}
-
#endif
Modified:
trunk/mcs/class/System.Web/System.Web.UI.WebControls.WebParts/WebPart.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI.WebControls.WebParts/WebPart.cs
2006-08-10 10:35:01 UTC (rev 63578)
+++ trunk/mcs/class/System.Web/System.Web.UI.WebControls.WebParts/WebPart.cs
2006-08-10 11:17:16 UTC (rev 63579)
@@ -46,10 +46,17 @@
}
- WebPartVerbCollection verbs;
+ WebPartVerbCollection verbs = new WebPartVerbCollection();
Allow allow;
string auth_filter;
string catalog_icon_url;
+ WebPartExportMode exportMode = WebPartExportMode.None;
+ string titleIconImageUrl,
+ titleUrl,
+ helpUrl;
+ bool isStatic, hidden, isClosed, hasSharedData, hasUserData;
+ WebPartHelpMode helpMode = WebPartHelpMode.Navigate;
+ int zoneIndex ;
protected WebPart ()
{
@@ -57,6 +64,14 @@
allow = Allow.Close | Allow.Connect | Allow.Edit |
Allow.Hide | Allow.Minimize | Allow.ZoneChange;
auth_filter = "";
catalog_icon_url = "";
+ titleIconImageUrl = string.Empty;
+ titleUrl = string.Empty;
+ helpUrl = string.Empty;
+ isStatic = false;
+ hasUserData = false;
+ hasSharedData = false;
+ hidden = false;
+ isClosed = false;
}
#if IWebEditableInterface
@@ -276,10 +291,10 @@
public virtual WebPartExportMode ExportMode
{
get {
- throw new NotImplementedException ();
+ return exportMode;
}
set {
- throw new NotImplementedException ();
+ exportMode = value;
}
}
@@ -287,7 +302,7 @@
public bool HasSharedData
{
get {
- throw new NotImplementedException ();
+ return hasSharedData;
}
}
@@ -295,7 +310,7 @@
public bool HasUserData
{
get {
- throw new NotImplementedException ();
+ return hasUserData;
}
}
@@ -314,10 +329,10 @@
public virtual WebPartHelpMode HelpMode
{
get {
- throw new NotImplementedException ();
+ return helpMode;
}
set {
- throw new NotImplementedException ();
+ helpMode = value;
}
}
@@ -325,10 +340,10 @@
public virtual string HelpUrl
{
get {
- throw new NotImplementedException ();
+ return helpUrl;
}
set {
- throw new NotImplementedException ();
+ helpUrl = value;
}
}
@@ -336,10 +351,10 @@
public virtual bool Hidden
{
get {
- throw new NotImplementedException ();
+ return hidden;
}
set {
- throw new NotImplementedException ();
+ hidden = value;
}
}
@@ -357,7 +372,7 @@
public bool IsClosed
{
get {
- throw new NotImplementedException ();
+ return isClosed;
}
}
@@ -381,7 +396,7 @@
public bool IsStatic
{
get {
- throw new NotImplementedException ();
+ return isStatic;
}
}
@@ -389,7 +404,7 @@
public virtual string Subtitle
{
get {
- throw new NotImplementedException ();
+ return string.Empty;
}
}
@@ -408,10 +423,10 @@
public virtual string TitleIconImageUrl
{
get {
- throw new NotImplementedException ();
+ return titleIconImageUrl;
}
set {
- throw new NotImplementedException ();
+ titleIconImageUrl = value;
}
}
@@ -419,10 +434,10 @@
public virtual string TitleUrl
{
get {
- throw new NotImplementedException ();
+ return titleUrl;
}
set {
- throw new NotImplementedException ();
+ titleUrl = value;
}
}
@@ -478,7 +493,7 @@
public int ZoneIndex
{
get {
- throw new NotImplementedException ();
+ return zoneIndex;
}
}
}
Modified:
trunk/mcs/class/System.Web/System.Web.UI.WebControls.WebParts/WebPartConnectionsEventArgs.cs
===================================================================
---
trunk/mcs/class/System.Web/System.Web.UI.WebControls.WebParts/WebPartConnectionsEventArgs.cs
2006-08-10 10:35:01 UTC (rev 63578)
+++
trunk/mcs/class/System.Web/System.Web.UI.WebControls.WebParts/WebPartConnectionsEventArgs.cs
2006-08-10 11:17:16 UTC (rev 63579)
@@ -38,7 +38,7 @@
private WebPart consumerPart;
private ProviderConnectionPoint providerPoint;
private ConsumerConnectionPoint consumerPoint;
- private Connection connection;
+ private WebPartConnection connection;
public WebPartConnectionsEventArgs (WebPart providerPart,
ProviderConnectionPoint providerPoint,
WebPart consumerPart,
ConsumerConnectionPoint consumerPoint) : this (providerPart,
@@ -46,16 +46,16 @@
{}
public WebPartConnectionsEventArgs (WebPart providerPart,
ProviderConnectionPoint providerPoint,
- WebPart consumerPart,
ConsumerConnectionPoint consumerPoint, Connection connection)
+ WebPart consumerPart,
ConsumerConnectionPoint consumerPoint, WebPartConnection connection)
{
this.providerPart = providerPart;
this.providerPoint = providerPoint;
this.consumerPart = consumerPart;
- this.consumerPart = consumerPoint;
+ this.consumerPoint = consumerPoint;
this.connection = connection;
}
- public Connection Connection {
+ public WebPartConnection Connection {
get { return connection; }
}
@@ -63,7 +63,7 @@
get { return consumerPoint; }
}
- public WebPart ConsumerWebPart {
+ public WebPart Consumer {
get { return consumerPart; }
}
@@ -71,7 +71,7 @@
get { return providerPoint; }
}
- public WebPart ProviderWebPart {
+ public WebPart Provider {
get { return providerPart; }
}
}
Modified:
trunk/mcs/class/System.Web/System.Web.UI.WebControls.WebParts/WebPartDisplayMode.cs
===================================================================
---
trunk/mcs/class/System.Web/System.Web.UI.WebControls.WebParts/WebPartDisplayMode.cs
2006-08-10 10:35:01 UTC (rev 63578)
+++
trunk/mcs/class/System.Web/System.Web.UI.WebControls.WebParts/WebPartDisplayMode.cs
2006-08-10 11:17:16 UTC (rev 63579)
@@ -32,19 +32,44 @@
using System.ComponentModel;
-namespace System.Web.UI.WebControls.WebParts
-{
- public abstract class WebPartDisplayMode
- {
- protected WebPartDisplayMode ()
- {}
-
- public abstract bool IsEnabled (WebPartManager manager);
-
- public abstract bool AllowPageDesign { get; }
-
- public abstract string Name { get; }
-
+namespace System.Web.UI.WebControls.WebParts {
+ public abstract class WebPartDisplayMode {
+ string name;
+ protected WebPartDisplayMode( string name ) {
+ this.name = name;
+ }
+
+ public virtual bool IsEnabled( WebPartManager manager ) {
+ if ( this.RequiresPersonalization )
+ return manager.Personalization.IsModifiable;
+ return true;
+ }
+
+ public virtual bool AssociatedWithToolZone {
+ get {
+ return false;
+ }
+ }
+
+ public virtual bool ShowHiddenWebParts {
+ get {
+ return false;
+ }
+ }
+
+
+ public virtual bool RequiresPersonalization {
+ get {
+ return false;
+ }
+ }
+
+ public virtual bool AllowPageDesign {
+ get { return false; }
+ }
+
+ public virtual string Name { get { return name; } }
+
}
}
#endif
Modified:
trunk/mcs/class/System.Web/System.Web.UI.WebControls.WebParts/WebPartVerb.cs
===================================================================
---
trunk/mcs/class/System.Web/System.Web.UI.WebControls.WebParts/WebPartVerb.cs
2006-08-10 10:35:01 UTC (rev 63578)
+++
trunk/mcs/class/System.Web/System.Web.UI.WebControls.WebParts/WebPartVerb.cs
2006-08-10 11:17:16 UTC (rev 63579)
@@ -1,4 +1,4 @@
-//
+//
// System.Web.UI.WebControls.WebParts.WebPartVerb.cs
//
// Authors:
@@ -48,29 +48,34 @@
private string imageUrl = string.Empty;
private string text = string.Empty;
private bool visible = true;
+ private string id;
+
+ public string ID {
+ get { return id;}
+ }
- public WebPartVerb (string clientHandler)
- {
+ public WebPartVerb (string id, string clientHandler) {
+ this.id = id;
this.clientClickHandler = clientHandler;
stateBag = new StateBag ();
stateBag.Add ("clientClickHandler", clientHandler);
-
}
- public WebPartVerb (WebPartEventHandler serverHandler)
- {
- this.serverClickHandler = serverHandler;
+
+ public WebPartVerb (string id, WebPartEventHandler
serverClickHandler) {
+ this.id = id;
+ this.serverClickHandler = serverClickHandler;
stateBag = new StateBag ();
- stateBag.Add ("serverClickHandler", serverHandler);
+ stateBag.Add ("serverClickHandler", serverClickHandler);
}
- public WebPartVerb (WebPartEventHandler serverHandler, string
clientHandler)
- {
- this.serverClickHandler = serverHandler;
- this.clientClickHandler = clientHandler;
+ public WebPartVerb (string id, WebPartEventHandler
serverClickHandler, string clientClickHandler) {
+ this.id = id;
+ this.serverClickHandler = serverClickHandler;
+ this.clientClickHandler = clientClickHandler;
stateBag = new StateBag ();
- stateBag.Add ("serverClickHandler", serverHandler);
- stateBag.Add ("clientClickHandler", clientHandler);
+ stateBag.Add ("serverClickHandler", serverClickHandler);
+ stateBag.Add ("clientClickHandler", clientClickHandler);
}
[MonoTODO]
@@ -149,7 +154,7 @@
[WebSysDescriptionAttribute ("Denotes URL of the image to be
displayed for the verb"),
EditorAttribute ("System.Web.UI.Design.ImageUrlEditor,
System.Design",
- "System.Drawing.Design.UITypeEditor,
System.Drawing"),
+ "UITypeEditor, System.Drawing"),
LocalizableAttribute (true), NotifyParentPropertyAttribute
(true)]
//UrlPropertyAttribute, DefaultValueAttribute (String.Empty)
public string ImageUrl {
@@ -191,4 +196,4 @@
}
}
}
-#endif
+#endif
\ No newline at end of file
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches