MenuDesigner Class
TOC
Collapse the table of content
Expand the table of content

MenuDesigner Class

 

Provides design-time support in a visual designer for the Menu control.

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


public class MenuDesigner : HierarchicalDataBoundControlDesigner, 
	IDataBindingSchemaProvider

NameDescription
System_CAPS_pubmethodMenuDesigner()

This API supports the product infrastructure and is not intended to be used directly from your code. Initializes a new instance of the MenuDesigner class.

NameDescription
System_CAPS_pubpropertyActionLists

Gets the designer action list collection for this designer.(Overrides HierarchicalDataBoundControlDesigner.ActionLists.)

System_CAPS_pubpropertyAllowResize

Gets a value indicating whether the control can be resized in the design-time environment.(Inherited from ControlDesigner.)

System_CAPS_pubpropertyAssociatedComponents

Gets the collection of components associated with the component managed by the designer.(Inherited from ComponentDesigner.)

System_CAPS_pubpropertyAutoFormats

Gets the collection of predefined formatting schemes to display in the Auto Format dialog box.(Overrides ControlDesigner.AutoFormats.)

System_CAPS_pubpropertyBehavior

Obsolete.Gets or sets the DHTML behavior that is associated with the designer.(Inherited from HtmlControlDesigner.)

System_CAPS_protpropertyCanRefreshSchema

Gets a value that indicates whether the provider can refresh the schema.

System_CAPS_pubpropertyComponent

Gets the component this designer is designing.(Inherited from ComponentDesigner.)

System_CAPS_pubpropertyDataBindings

Gets the data bindings collection for the current control.(Inherited from HtmlControlDesigner.)

System_CAPS_protpropertyDataBindingsEnabled

Gets a value indicating whether data binding is supported by the containing region for the associated control.(Inherited from ControlDesigner.)

System_CAPS_pubpropertyDataSource

Gets or sets the value of the DataSource property for the associated control.(Inherited from BaseDataBoundControlDesigner.)

System_CAPS_pubpropertyDataSourceDesigner

Provides access to the designer of the data source, when one is selected for data binding.(Inherited from HierarchicalDataBoundControlDesigner.)

System_CAPS_pubpropertyDataSourceID

Gets or sets the value of the DataSourceID property of the underlying BaseDataBoundControl object.(Inherited from BaseDataBoundControlDesigner.)

System_CAPS_protpropertyDesignerState

Gets an object that is used to persist data for the associated control at design time.(Inherited from ControlDesigner.)

System_CAPS_pubpropertyDesignerView

Gets the default view of the data source that is bound to the associated control. (Inherited from HierarchicalDataBoundControlDesigner.)

System_CAPS_protpropertyDesignTimeElement

Obsolete.Gets the design-time object representing the control that is associated with the HtmlControlDesigner object on the design surface.(Inherited from HtmlControlDesigner.)

System_CAPS_protpropertyDesignTimeElementView

Obsolete.Gets the view-control object for the control designer.(Inherited from ControlDesigner.)

System_CAPS_pubpropertyDesignTimeHtmlRequiresLoadComplete

Obsolete.Gets a value indicating whether the design host must finish loading before the GetDesignTimeHtml method can be called.(Inherited from ControlDesigner.)

System_CAPS_pubpropertyExpressions

Gets the expression bindings for the current control at design time.(Inherited from HtmlControlDesigner.)

System_CAPS_protpropertyHidePropertiesInTemplateMode

This API supports the product infrastructure and is not intended to be used directly from your code. Gets a value indicating whether the properties of the associated control are hidden when the control is in template mode.(Inherited from ControlDesigner.)

System_CAPS_pubpropertyID

Gets or sets the ID string for the control.(Inherited from ControlDesigner.)

System_CAPS_protpropertyInheritanceAttribute

Gets an attribute that indicates the type of inheritance of the associated component.(Inherited from ComponentDesigner.)

System_CAPS_protpropertyInherited

Gets a value indicating whether this component is inherited.(Inherited from ComponentDesigner.)

System_CAPS_protpropertyInTemplateMode

Gets a value indicating whether the control is in either template viewing or editing mode in the design host. The InTemplateMode property is read-only.(Inherited from ControlDesigner.)

System_CAPS_pubpropertyIsDirty

Obsolete.Gets or sets a value indicating whether the Web server control has been marked as changed.(Inherited from ControlDesigner.)

System_CAPS_protpropertyParentComponent

Gets the parent component for this designer.(Inherited from ComponentDesigner.)

System_CAPS_pubpropertyReadOnly

Obsolete.Gets or sets a value indicating whether the properties of the control are read-only at design time.(Inherited from ControlDesigner.)

System_CAPS_protpropertyRootDesigner

Gets the control designer for the Web Forms page that contains the associated control.(Inherited from ControlDesigner.)

System_CAPS_protpropertySchema

Gets a schema that describes the data source view for the associated Menu control.

System_CAPS_protpropertyShadowProperties

Gets a collection of property values that override user settings.(Inherited from ComponentDesigner.)

System_CAPS_pubpropertyShouldCodeSerialize

Obsolete.Gets or sets a value indicating whether to create a field declaration for the control in the code-behind file for the current design document during serialization.(Inherited from HtmlControlDesigner.)

System_CAPS_protpropertyTag

Gets an object representing the HTML markup element for the associated control.(Inherited from ControlDesigner.)

System_CAPS_pubpropertyTemplateGroups

Gets a collection of template groups for the templates of the associated control.(Overrides ControlDesigner.TemplateGroups.)

System_CAPS_protpropertyUseDataSourcePickerActionList

Gets a value that indicates whether the control should render its default action lists, which contain a data source ID drop-down list and related tasks.(Inherited from HierarchicalDataBoundControlDesigner.)

System_CAPS_protpropertyUsePreviewControl

Gets a value indicating whether the designer should use a copy of the associated control or use the control itself to generate the design-time markup.(Overrides ControlDesigner.UsePreviewControl.)

System_CAPS_pubpropertyVerbs

Gets the design-time verbs supported by the component that is associated with the designer.(Inherited from ComponentDesigner.)

System_CAPS_pubpropertyViewControl

Gets or sets a Web server control that can be used for previewing the design-time HTML markup.(Inherited from ControlDesigner.)

System_CAPS_pubpropertyViewControlCreated

Gets or sets a value indicating whether a View control has been created for display on the design surface.(Inherited from ControlDesigner.)

System_CAPS_protpropertyVisible

Gets a value that indicates whether the control is visible at design time.(Inherited from ControlDesigner.)

NameDescription
System_CAPS_protmethodConnectToDataSource()

Performs the actions that are necessary to connect to the current data source.(Inherited from HierarchicalDataBoundControlDesigner.)

System_CAPS_protmethodCreateDataSource()

Creates a new data source for the associated control.(Inherited from HierarchicalDataBoundControlDesigner.)

System_CAPS_protmethodCreateErrorDesignTimeHtml(String)

Creates HTML markup to display a specified error message at design time.(Inherited from ControlDesigner.)

System_CAPS_protmethodCreateErrorDesignTimeHtml(String, Exception)

Creates the HTML markup to display a specified exception error message at design time.(Inherited from ControlDesigner.)

System_CAPS_protmethodCreatePlaceHolderDesignTimeHtml()

Provides a simple rectangular placeholder representation that displays the type and ID of the control.(Inherited from ControlDesigner.)

System_CAPS_protmethodCreatePlaceHolderDesignTimeHtml(String)

Provides a simple rectangular placeholder representation that displays the type and ID of the control, and also additional specified instructions or information.(Inherited from ControlDesigner.)

System_CAPS_protmethodCreateViewControl()

Returns a copy of the associated control for viewing or rendering on the design surface.(Inherited from ControlDesigner.)

System_CAPS_protmethodDataBind(BaseDataBoundControl)

Binds the associated control to the design-time data source.(Overrides HierarchicalDataBoundControlDesigner.DataBind(BaseDataBoundControl).)

System_CAPS_protmethodDisconnectFromDataSource()

Performs the actions that are necessary to disconnect from the current data source.(Inherited from HierarchicalDataBoundControlDesigner.)

System_CAPS_pubmethodDispose()

Releases all resources used by the ComponentDesigner.(Inherited from ComponentDesigner.)

System_CAPS_protmethodDispose(Boolean)

Releases the unmanaged resources that are used by the BaseDataBoundControlDesigner object, and optionally releases the managed resources.(Inherited from BaseDataBoundControlDesigner.)

System_CAPS_pubmethodDoDefaultAction()

Creates a method signature in the source code file for the default event on the component and navigates the user's cursor to that location.(Inherited from ComponentDesigner.)

System_CAPS_pubmethodEquals(Object)

Determines whether the specified object is equal to the current object.(Inherited from Object.)

System_CAPS_protmethodFinalize()

Attempts to free resources by calling Dispose(false) before the object is reclaimed by garbage collection.(Inherited from ComponentDesigner.)

System_CAPS_pubmethodGetBounds()

Retrieves the coordinates of the rectangle representing the boundaries for the control as displayed on the design surface.(Inherited from ControlDesigner.)

System_CAPS_protmethodGetDesignTimeDataSource()

Gets a data source that can be used at design time for the associated control.(Inherited from HierarchicalDataBoundControlDesigner.)

System_CAPS_pubmethodGetDesignTimeHtml()

Gets the markup that is used to render the associated control at design time. (Overrides BaseDataBoundControlDesigner.GetDesignTimeHtml().)

System_CAPS_pubmethodGetDesignTimeHtml(DesignerRegionCollection)

Retrieves the HTML markup to display the control and populates the collection with the current control designer regions.(Inherited from ControlDesigner.)

System_CAPS_pubmethodGetEditableDesignerRegionContent(EditableDesignerRegion)

Returns the content for an editable region of the design-time view of the associated control.(Inherited from ControlDesigner.)

System_CAPS_protmethodGetEmptyDesignTimeHtml()

Gets the markup that renders a placeholder for the associated control at design time when no markup is otherwise available.(Overrides BaseDataBoundControlDesigner.GetEmptyDesignTimeHtml().)

System_CAPS_protmethodGetErrorDesignTimeHtml(Exception)

Provides the markup that renders the associated control at design time when an error has occurred.(Overrides BaseDataBoundControlDesigner.GetErrorDesignTimeHtml(Exception).)

System_CAPS_pubmethodGetHashCode()

Serves as the default hash function. (Inherited from Object.)

System_CAPS_pubmethodGetPersistenceContent()

Retrieves the persistable inner HTML markup of the control at design time.(Inherited from ControlDesigner.)

System_CAPS_pubmethodGetPersistInnerHtml()

Obsolete.Retrieves the persistable inner HTML markup of the control.(Inherited from ControlDesigner.)

System_CAPS_protmethodGetSampleDataSource()

Constructs a sample data source to use at design time for the associated control.(Overrides HierarchicalDataBoundControlDesigner.GetSampleDataSource().)

System_CAPS_protmethodGetService(Type)

Attempts to retrieve the specified type of service from the design mode site of the designer's component.(Inherited from ComponentDesigner.)

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_pubmethodGetViewRendering()

Retrieves an object that contains the design-time markup for the content and regions of the associated control.(Inherited from ControlDesigner.)

System_CAPS_pubmethodInitialize(IComponent)

Prepares the designer to view, edit, and design the associated control.(Overrides BaseDataBoundControlDesigner.Initialize(IComponent).)

System_CAPS_pubmethodInitializeExistingComponent(IDictionary)

Reinitializes an existing component.(Inherited from ComponentDesigner.)

System_CAPS_pubmethodInitializeNewComponent(IDictionary)

Initializes a newly created component.(Inherited from ComponentDesigner.)

System_CAPS_pubmethodInitializeNonDefault()

Obsolete.Initializes the settings for an imported component that is already initialized to settings other than the defaults.(Inherited from ComponentDesigner.)

System_CAPS_pubmethodInvalidate()

Invalidates the whole area of the control that is displayed on the design surface and signals the control designer to redraw the control.(Inherited from ControlDesigner.)

System_CAPS_pubmethodInvalidate(Rectangle)

Invalidates the specified area of the control that is displayed on the design surface and signals the control designer to redraw the control.(Inherited from ControlDesigner.)

System_CAPS_protmethodInvokeGetInheritanceAttribute(ComponentDesigner)

Gets the InheritanceAttribute of the specified ComponentDesigner.(Inherited from ComponentDesigner.)

System_CAPS_pubmethodIsPropertyBound(String)

Obsolete.Retrieves a value indicating whether the specified property on the associated control is data-bound.(Inherited from ControlDesigner.)

System_CAPS_pubmethodLocalize(IDesignTimeResourceWriter)

Uses the provided resource writer to persist the localizable properties of the associated control to a resource in the design host.(Inherited from ControlDesigner.)

System_CAPS_protmethodMemberwiseClone()

Creates a shallow copy of the current Object.(Inherited from Object.)

System_CAPS_pubmethodOnAutoFormatApplied(DesignerAutoFormat)

Called when a predefined, automatic formatting scheme has been applied to the associated control.(Inherited from ControlDesigner.)

System_CAPS_protmethodOnBehaviorAttached()

Obsolete.Called when a behavior is associated with the element.(Inherited from HtmlControlDesigner.)

System_CAPS_protmethodOnBehaviorDetaching()

Obsolete.Called when a behavior disassociates from the element.(Inherited from HtmlControlDesigner.)

System_CAPS_protmethodOnBindingsCollectionChanged(String)

Obsolete.Called when the data-binding collection changes.(Inherited from ControlDesigner.)

System_CAPS_protmethodOnClick(DesignerRegionMouseEventArgs)

Called by the design host when the user clicks the associated control at design time.(Inherited from ControlDesigner.)

System_CAPS_pubmethodOnComponentChanged(Object, ComponentChangedEventArgs)

Called when the associated control changes.(Inherited from ControlDesigner.)

System_CAPS_pubmethodOnComponentChanging(Object, ComponentChangingEventArgs)

Represents the method that will handle the ComponentChanging event for the associated control. (Inherited from ControlDesigner.)

System_CAPS_protmethodOnControlResize()

Obsolete.Called when the associated Web server control has been resized in the design host at design time.(Inherited from ControlDesigner.)

System_CAPS_protmethodOnDataSourceChanged(Boolean)

Called when the data source of the associated BaseDataBoundControl object changes. (Inherited from BaseDataBoundControlDesigner.)

System_CAPS_protmethodOnPaint(PaintEventArgs)

Called when the control designer draws the associated control on the design surface, if the CustomPaint value is true.(Inherited from ControlDesigner.)

System_CAPS_protmethodOnSchemaRefreshed()

Called when the data source of the associated BaseDataBoundControl object loads a new schema. (Inherited from BaseDataBoundControlDesigner.)

System_CAPS_pubmethodOnSetComponentDefaults()

Obsolete.Sets the default properties for the component.(Inherited from ComponentDesigner.)

System_CAPS_pubmethodOnSetParent()

Provides a way to perform additional processing when the associated control is attached to a parent control.(Inherited from HtmlControlDesigner.)

System_CAPS_protmethodPostFilterAttributes(IDictionary)

Allows a designer to change or remove items from the set of attributes that it exposes through a TypeDescriptor.(Inherited from ComponentDesigner.)

System_CAPS_protmethodPostFilterEvents(IDictionary)

Allows a designer to change or remove items from the set of events that it exposes through a TypeDescriptor.(Inherited from ComponentDesigner.)

System_CAPS_protmethodPostFilterProperties(IDictionary)

Allows a designer to change or remove items from the set of properties that it exposes through a TypeDescriptor.(Inherited from ComponentDesigner.)

System_CAPS_protmethodPreFilterAttributes(IDictionary)

Allows a designer to add to the set of attributes that it exposes through a TypeDescriptor.(Inherited from ComponentDesigner.)

System_CAPS_protmethodPreFilterEvents(IDictionary)

Sets the list of events that are exposed at design-time for the TypeDescriptor object for the component.(Inherited from HtmlControlDesigner.)

System_CAPS_protmethodPreFilterProperties(IDictionary)

Used by the designer to remove properties from or add additional properties to the display in the Properties grid or to shadow properties of the associated control.(Inherited from HierarchicalDataBoundControlDesigner.)

System_CAPS_protmethodRaiseComponentChanged(MemberDescriptor, Object, Object)

Notifies the IComponentChangeService that this component has been changed.(Inherited from ComponentDesigner.)

System_CAPS_protmethodRaiseComponentChanging(MemberDescriptor)

Notifies the IComponentChangeService that this component is about to be changed.(Inherited from ComponentDesigner.)

System_CAPS_pubmethodRaiseResizeEvent()

Obsolete.Raises the OnControlResize event.(Inherited from ControlDesigner.)

System_CAPS_protmethodRefreshSchema(Boolean)

Refreshes the schema of the data source view for the associated Menu control.

System_CAPS_pubmethodRegisterClone(Object, Object)

Registers internal data in a cloned control.(Inherited from ControlDesigner.)

System_CAPS_pubmethodSetEditableDesignerRegionContent(EditableDesignerRegion, String)

Specifies the content for an editable region of the control at design time. (Inherited from ControlDesigner.)

System_CAPS_protmethodSetRegionContent(EditableDesignerRegion, String)

Specifies the content for an editable region in the design-time view of the control.(Inherited from ControlDesigner.)

System_CAPS_protmethodSetViewFlags(ViewFlags, Boolean)

Assigns the specified bitwise ViewFlags enumeration to the specified flag value.(Inherited from ControlDesigner.)

System_CAPS_pubmethodToString()

Returns a string that represents the current object.(Inherited from Object.)

System_CAPS_pubmethodUpdateDesignTimeHtml()

Refreshes the design-time HTML markup for the associated Web server control by calling the GetDesignTimeHtml method.(Inherited from ControlDesigner.)

NameDescription
System_CAPS_pubinterfaceSystem_CAPS_privmethodIDesignerFilter.PostFilterAttributes(IDictionary)

For a description of this member, see the IDesignerFilter.PostFilterAttributes method.(Inherited from ComponentDesigner.)

System_CAPS_pubinterfaceSystem_CAPS_privmethodIDesignerFilter.PostFilterEvents(IDictionary)

For a description of this member, see the IDesignerFilter.PostFilterEvents method.(Inherited from ComponentDesigner.)

System_CAPS_pubinterfaceSystem_CAPS_privmethodIDesignerFilter.PostFilterProperties(IDictionary)

For a description of this member, see the IDesignerFilter.PostFilterProperties method.(Inherited from ComponentDesigner.)

System_CAPS_pubinterfaceSystem_CAPS_privmethodIDesignerFilter.PreFilterAttributes(IDictionary)

For a description of this member, see the IDesignerFilter.PreFilterAttributes method.(Inherited from ComponentDesigner.)

System_CAPS_pubinterfaceSystem_CAPS_privmethodIDesignerFilter.PreFilterEvents(IDictionary)

For a description of this member, see the IDesignerFilter.PreFilterEvents method.(Inherited from ComponentDesigner.)

System_CAPS_pubinterfaceSystem_CAPS_privmethodIDesignerFilter.PreFilterProperties(IDictionary)

For a description of this member, see the IDesignerFilter.PreFilterProperties method.(Inherited from ComponentDesigner.)

System_CAPS_pubinterfaceSystem_CAPS_privmethodIDataBindingSchemaProvider.RefreshSchema(Boolean)

For a description of this member, see the IDataBindingSchemaProvider.RefreshSchema method.

System_CAPS_pubinterfaceSystem_CAPS_privpropertyITreeDesigner.Children

For a description of this member, see the ITreeDesigner.Children property.(Inherited from ComponentDesigner.)

System_CAPS_pubinterfaceSystem_CAPS_privpropertyITreeDesigner.Parent

For a description of this member, see the ITreeDesigner.Parent property.(Inherited from ComponentDesigner.)

System_CAPS_pubinterfaceSystem_CAPS_privpropertyIDataBindingSchemaProvider.CanRefreshSchema

Gets a value indicating whether the provider can refresh the schema. For a description of this member, see the IDataBindingSchemaProvider.CanRefreshSchema property.

System_CAPS_pubinterfaceSystem_CAPS_privpropertyIDataBindingSchemaProvider.Schema

Gets the current schema object for the designer. For a description of this member, see the IDataBindingSchemaProvider.Schema property.

The Menu class provides a hierarchical menu Web server control.

In a visual designer, when you switch from Source to Design view, the markup source code that describes the associated Menu control is parsed and a design-time version of the control is created on the design surface. When you switch back to Source view, the design-time control is persisted to markup and added to the existing markup for the Web page. The MenuDesigner class provides design-time support for Menu controls in a visual designer.

The ActionLists property returns a DesignerActionListCollection object, which typically contains an object that is derived from the DesignerActionList class for each level in the inheritance tree of the designer. The AutoFormats property returns a collection of formatting schemes for display in the Auto Format dialog box.

The TemplateGroups property returns a collection of template groups for the templates of the associated Menu control. The UsePreviewControl property always returns true, indicating that the designer creates a temporary copy of the associated Menu to generate the design-time markup.

The MenuDesigner class methods provide the following functionality:

  • The Initialize method prepares the designer to view, edit, and design the associated Menu control. The GetDesignTimeHtml method returns the markup that is used to render the associated Menu at design time.

  • The GetEmptyDesignTimeHtml method gets the markup that renders a placeholder for the associated control at design time when no markup is otherwise available. The GetErrorDesignTimeHtml method provides the markup that renders the associated control at design time when an error has occurred.

  • The DataBind method binds the associated Menu control to the design-time data source. The GetSampleDataSource method constructs a sample data source that can be used at design time for the associated control.

The following code example shows how to extend the MenuDesigner class to change the appearance of controls that are derived from the Menu control at design time.

The example derives the MyMenu class from the Menu. The MyMenu class is a copy of the Menu. The example also derives the MyMenuDesigner class from the MenuDesigner class, and then applies a DesignerAttribute attribute for the MyMenuDesigner on the MyMenu class.

The MyMenuDesigner overrides the following MenuDesigner members:

  • The GetDesignTimeHtml method to draw an orange, dotted border around the control to make its extent more visible.

  • The GetErrorDesignTimeHtml method to generate the markup for a placeholder that includes the error message, which is rendered in red, bold text.

  • The GetEmptyDesignTimeHtml to generate the markup for a placeholder that contains a message indicating that no menu items are defined.

  • The Initialize method to throw an ArgumentException exception, if the associated control is not a MyMenu object.

using System;
using System.Web;
using System.Web.UI.WebControls;
using System.Web.UI.Design.WebControls;
using System.ComponentModel;
using System.Security.Permissions;
using System.Drawing;

namespace Examples.CS.WebControls.Design
{
    // The MyMenu is a copy of the Menu.
    [AspNetHostingPermission(SecurityAction.Demand, 
        Level = AspNetHostingPermissionLevel.Minimal)]
    [AspNetHostingPermission(SecurityAction.InheritanceDemand, 
        Level = AspNetHostingPermissionLevel.Minimal)]
    [Designer(typeof(Examples.CS.WebControls.Design.MyMenuDesigner))]
    public class MyMenu : Menu
    {
    } // MyMenu

    // Override members of the MenuDesigner.
    public class MyMenuDesigner : MenuDesigner
    {
        // Generate the design-time markup for the control when an error occurs.
        protected override string GetErrorDesignTimeHtml(Exception ex) 
        {
            // Write the error message text in red, bold.
            string errorRendering =
                "<span style=\"font-weight:bold; color:Red; \">" +
                ex.Message + "</span>";

            return CreatePlaceHolderDesignTimeHtml(errorRendering);
        } // GetErrorDesignTimeHtml

        // Generate the design-time markup for the control 
        // when the template is empty.
        protected override string GetEmptyDesignTimeHtml()
        {
            string noElements = "Contains no menu items.";

            return CreatePlaceHolderDesignTimeHtml(noElements);
        } // GetEmptyDesignTimeHtml

        // Generate the design-time markup.
        public override string GetDesignTimeHtml()
        {
            // Make the control more visible in the designer.  If the border 
            // style is None or NotSet, change the border to an orange dotted line. 
            MyMenu myMenuCtl = (MyMenu)ViewControl;
            string markup = null;

            // Check if the border style should be changed.
            if (myMenuCtl.BorderStyle == BorderStyle.NotSet ||
                myMenuCtl.BorderStyle == BorderStyle.None)
            {
                BorderStyle oldBorderStyle = myMenuCtl.BorderStyle;
                Color oldBorderColor = myMenuCtl.BorderColor;

                // Set the design-time properties and catch any exceptions.
                try
                {
                    myMenuCtl.BorderStyle = BorderStyle.Dotted;
                    myMenuCtl.BorderColor = Color.FromArgb(0xFF7F00);

                    // Call the base method to generate the markup.
                    markup = base.GetDesignTimeHtml();
                }
                catch (Exception ex)
                {
                    markup = GetErrorDesignTimeHtml(ex);
                }
                finally
                {
                    // Restore the properties to their original settings.
                    myMenuCtl.BorderStyle = oldBorderStyle;
                    myMenuCtl.BorderColor = oldBorderColor;
                }
            }
            else
                // Call the base method to generate the markup.
                markup = base.GetDesignTimeHtml();

            return markup;

        } // GetDesignTimeHtml

        public override void Initialize(IComponent component)
        {
            // Ensure that only a MyMenu can be created in this designer.
            if (!(component is MyMenu))
                throw new ArgumentException(
                    "The component is not a MyMenu control.");

            base.Initialize(component);

        } // Initialize
    } // MyMenuDesigner
} // Examples.CS.WebControls.Design

.NET Framework
Available since 2.0

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

Return to top
Show:
© 2016 Microsoft