Export (0) Print
Expand All

DesignerRegion Class

Defines a region of content within the design-time markup for the associated control.

Namespace:  System.Web.UI.Design
Assembly:  System.Design (in System.Design.dll)

public class DesignerRegion : DesignerObject

The DesignerRegion type exposes the following members.

  NameDescription
Public methodDesignerRegion(ControlDesigner, String)Initializes a new instance of the DesignerRegion class with the specified name for a control designer.
Public methodDesignerRegion(ControlDesigner, String, Boolean)Initializes a new instance of the DesignerRegion class with the specified name for a control designer, optionally setting the instance as a selectable region in the designer.
Top

  NameDescription
Public propertyDescriptionGets or sets the description for a designer region.
Public propertyDesignerGets the associated designer component. (Inherited from DesignerObject.)
Public propertyDisplayNameGets or sets the friendly display name for a designer region.
Public propertyEnsureSizeGets or sets a value indicating whether the region size is to be explicitly set on the designer region by the design host.
Public propertyHighlightGets or sets a value indicating whether to highlight the designer region on the design surface.
Public propertyNameGets the name of the object. (Inherited from DesignerObject.)
Public propertyPropertiesGets the object's properties. (Inherited from DesignerObject.)
Public propertySelectableGets or sets a value indicating whether the designer region can be selected by the user on the design surface.
Public propertySelectedGets or sets a value indicating whether the designer region is currently selected on the design surface.
Public propertyUserDataGets or sets optional user data to associate with the designer region.
Top

  NameDescription
Public methodEquals(Object)Determines whether the specified object is equal to the current object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetBoundsRetrieves the size of the designer region on the design surface.
Public methodGetHashCodeServes as the default hash function. (Inherited from Object.)
Protected methodGetServiceGets a service from the design host, as identified by the provided type. (Inherited from DesignerObject.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Top

  NameDescription
Public fieldStatic memberDesignerRegionAttributeNameDefines the HTML attribute name for a designer region.
Top

  NameDescription
Explicit interface implemetationPrivate methodIServiceProvider.GetServiceFor a description of this member, see IServiceProvider.GetService. (Inherited from DesignerObject.)
Top

The DesignerRegion object represents a region of content within the design-time markup that is generated by a ControlDesigner implementation. A control developer uses designer regions in a custom ControlDesigner implementation to define separate areas within the design-time markup for the associated control and to provide editing and event handling for the area. A visual designer, such as Visual Studio 2005, can use designer regions to display the separate areas of a control on the design surface and to raise user events for the region to the control designer. Designer regions can simplify a control designer implementation because many region-based features are provided by the base designer classes and the visual designer.

The DesignerRegion class provides the base functionality for designer regions, such as the ability to click, select, and highlight a region in the design surface. Use a DesignerRegion object in a control designer implementation to define a region that does not require editing. Use the derived EditableDesignerRegion class in a control designer implementation to define a region with editable content at design time. Use the derived TemplatedEditableDesignerRegion class in a control designer implementation to define an editable region that represents a template in a control.

To support regions within a class that is derived from the ControlDesigner, override the GetDesignTimeHtml method and add one or more initialized DesignerRegion objects to the DesignerRegionCollection collection. Optionally, you can handle mouse clicks in the regions on the design surface by overriding the OnClick method.

Use the properties of a DesignerRegion object to determine how the region is displayed by the visual designer. Override the Selectable property to indicate that the region can be selected by the user on the design surface. Use the Highlight property to highlight the designer region in the visual designer; for example, you can highlight a region after a user has clicked to select it. Use the DisplayName and Description properties to store or retrieve additional details about the region. In particular, the Description property is used by the visual designer to display ToolTip information when the user moves the mouse pointer over the designer region. Use the Designer property to access the methods and properties of the control designer object that contains the designer region.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show:
© 2014 Microsoft