ConnectionsZoneDesigner Class
Assembly: System.Design (in system.design.dll)
ConnectionsZoneDesigner provides a design-time representation of a ConnectionsZone control with a menu to access the AutoFormats collection and the ViewInBrowseMode property for the convenience of the page developer. It is the only zone designer that does not support designer regions. This is because ConnectionsZone controls uses links to create connections instead of a drag-and-drop user interface (UI).
The AutoFormats collection and the ViewInBrowseMode property both appear on the verbs menu of the ConnectionsZone control. AutoFormats, when selected, provides a selection of color schemes. The ViewInBrowseMode check box, when selected, displays the contents of the control as it would appear in the browser; the control will be empty until a connection is made.
You can inherit from ConnectionsZoneDesigner to support a custom ConnectionsZone control as with any other control designer. You can override the GetDesignTimeHtml method to change the markup that renders the control. You can also override the AutoFormats collection to add a DesignerAutoFormatCollection with a custom scheme.
The following code example shows how to hide additional properties from a custom ConnectionsZone control by overriding the PreFilterProperties method.
using System; using System.Security.Permissions; using System.Web; using System.Web.UI.WebControls.WebParts; using System.Web.UI.Design.WebControls.WebParts; using System.ComponentModel; using System.Collections; /// <summary> /// ConnectionsZoneSample provides a blank inheritance of /// the ConnectionsZone class for the purpose of attaching /// a custom designer. /// ConnectionsZoneSampleDesigner shows how to edit the /// PreFilterProperties() method to hide a specific property /// at design time. /// </summary> namespace Samples.AspNet.CS.Controls { [AspNetHostingPermission(SecurityAction.Demand, Level = AspNetHostingPermissionLevel.Minimal)] [AspNetHostingPermission(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)] [Designer(typeof(ConnectionsZoneSampleDesigner))] public class ConnectionsZoneSample : ConnectionsZone {} public class ConnectionsZoneSampleDesigner : ConnectionsZoneDesigner { // Here is the property we will hide. string propertyToHide = "BackColor"; protected override void PreFilterProperties(IDictionary properties) { // Invoke the base method. This will hide those properties // specified in ConnectionsZoneDesigner. base.PreFilterProperties(properties); // Set attributes to remove it from the property grid and any editors. Attribute[] newAttributes = new Attribute[] { new BrowsableAttribute(false), new EditorBrowsableAttribute(EditorBrowsableState.Never)}; PropertyDescriptor property = (PropertyDescriptor)properties[propertyToHide]; if (property != null) { // Re-create the property with the attributes specified above. properties[propertyToHide] = TypeDescriptor.CreateProperty(property.ComponentType, property, newAttributes); } } } }
- SecurityPermission for calling unmanaged code. Demand value: Demand. Permission value: UnmanagedCode
System.ComponentModel.Design.ComponentDesigner
System.Web.UI.Design.HtmlControlDesigner
System.Web.UI.Design.ControlDesigner
System.Web.UI.Design.WebControls.WebParts.WebZoneDesigner
System.Web.UI.Design.WebControls.WebParts.ToolZoneDesigner
System.Web.UI.Design.WebControls.WebParts.ConnectionsZoneDesigner
Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.