DesignerRegion DesignerRegion DesignerRegion DesignerRegion Class

Definition

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

public ref class DesignerRegion : System::Web::UI::Design::DesignerObject
public class DesignerRegion : System.Web.UI.Design.DesignerObject
type DesignerRegion = class
    inherit DesignerObject
Public Class DesignerRegion
Inherits DesignerObject
Inheritance
DesignerRegionDesignerRegionDesignerRegionDesignerRegion
Derived

Remarks

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.

Constructors

DesignerRegion(ControlDesigner, String) DesignerRegion(ControlDesigner, String) DesignerRegion(ControlDesigner, String) DesignerRegion(ControlDesigner, String)

Initializes a new instance of the DesignerRegion class with the specified name for a control designer.

DesignerRegion(ControlDesigner, String, Boolean) DesignerRegion(ControlDesigner, String, Boolean) DesignerRegion(ControlDesigner, String, Boolean) DesignerRegion(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.

Fields

DesignerRegionAttributeName DesignerRegionAttributeName DesignerRegionAttributeName DesignerRegionAttributeName

Defines the HTML attribute name for a designer region.

Properties

Description Description Description Description

Gets or sets the description for a designer region.

Designer Designer Designer Designer

Gets the associated designer component.

(Inherited from DesignerObject)
DisplayName DisplayName DisplayName DisplayName

Gets or sets the friendly display name for a designer region.

EnsureSize EnsureSize EnsureSize EnsureSize

Gets or sets a value indicating whether the region size is to be explicitly set on the designer region by the design host.

Highlight Highlight Highlight Highlight

Gets or sets a value indicating whether to highlight the designer region on the design surface.

Name Name Name Name

Gets the name of the object.

(Inherited from DesignerObject)
Properties Properties Properties Properties

Gets the object's properties.

(Inherited from DesignerObject)
Selectable Selectable Selectable Selectable

Gets or sets a value indicating whether the designer region can be selected by the user on the design surface.

Selected Selected Selected Selected

Gets or sets a value indicating whether the designer region is currently selected on the design surface.

UserData UserData UserData UserData

Gets or sets optional user data to associate with the designer region.

Methods

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetBounds() GetBounds() GetBounds() GetBounds()

Retrieves the size of the designer region on the design surface.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetService(Type) GetService(Type) GetService(Type) GetService(Type)

Gets a service from the design host, as identified by the provided type.

(Inherited from DesignerObject)
GetType() GetType() GetType() GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
ToString() ToString() ToString() ToString()

Returns a string that represents the current object.

(Inherited from Object)

Explicit Interface Implementations

IServiceProvider.GetService(Type) IServiceProvider.GetService(Type) IServiceProvider.GetService(Type) IServiceProvider.GetService(Type)

For a description of this member, see GetService(Type).

(Inherited from DesignerObject)

Applies to

See also