ערוך

שתף באמצעות


MenuBindingsEditor Class

Definition

Provides a component editor for the DataBindings collection of the associated Menu control.

public ref class MenuBindingsEditor : System::Drawing::Design::UITypeEditor
public class MenuBindingsEditor : System.Drawing.Design.UITypeEditor
type MenuBindingsEditor = class
    inherit UITypeEditor
Public Class MenuBindingsEditor
Inherits UITypeEditor
Inheritance
MenuBindingsEditor

Examples

The following code example shows how to use the EditorAttribute attribute to associate the MenuBindingsEditor class and the UITypeEditor class (the bindings editor base class) with a property in a custom control, derived from the WebControl class, that gets and sets a MenuItemCollection collection.

private MenuItemBindingCollection localBindings;

// Associate the MenuBindingsEditor with the DataBindings. 
[Editor(typeof(System.Web.UI.Design.WebControls.MenuBindingsEditor),
    typeof(UITypeEditor))]
public MenuItemBindingCollection DataBindings
{
    get { return localBindings; }
    set { localBindings = value; }
} // DataBindings
Private localBindings As MenuItemBindingCollection

' Associate the MenuBindingsEditor with the DataBindings.
<EditorAttribute( GetType(System.Web.UI.Design.WebControls. _
    MenuBindingsEditor), _
    GetType(UITypeEditor))> _
Public Property DataBindings() As MenuItemBindingCollection
    Get
        Return localBindings
    End Get
    Set
        localBindings = value
    End Set
End Property ' DataBindings

Remarks

The MenuBindingsEditor class provides a user interface for editing the MenuItemBinding elements of the DataBindings collection within the associated Menu control.

The MenuBindingsEditor object is invoked by selecting the ellipsis () button on the DataBindings property in the Properties grid of the visual designer, or by choosing Edit Menu Items from the Common Tasks context menu on the control.

The EditValue method edits the values of the data bindings collection of the associated Menu control. The GetEditStyle method gets the editing style that is associated with this editor.

Constructors

MenuBindingsEditor()

Initializes a new instance of the MenuBindingsEditor class.

Properties

IsDropDownResizable

Gets a value indicating whether drop-down editors should be resizable by the user.

(Inherited from UITypeEditor)

Methods

EditValue(IServiceProvider, Object)

Edits the value of the specified object using the editor style indicated by the GetEditStyle() method.

(Inherited from UITypeEditor)
EditValue(ITypeDescriptorContext, IServiceProvider, Object)

Edits the value of the data bindings collection of the associated Menu control.

Equals(Object)

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

(Inherited from Object)
GetEditStyle()

Gets the editor style used by the EditValue(IServiceProvider, Object) method.

(Inherited from UITypeEditor)
GetEditStyle(ITypeDescriptorContext)

Gets the editing style that is associated with this editor.

GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetPaintValueSupported()

Indicates whether this editor supports painting a representation of an object's value.

(Inherited from UITypeEditor)
GetPaintValueSupported(ITypeDescriptorContext)

Indicates whether the specified context supports painting a representation of an object's value within the specified context.

(Inherited from UITypeEditor)
GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
PaintValue(Object, Graphics, Rectangle)

Paints a representation of the value of the specified object to the specified canvas.

(Inherited from UITypeEditor)
PaintValue(PaintValueEventArgs)

Paints a representation of the value of an object using the specified PaintValueEventArgs.

(Inherited from UITypeEditor)
ToString()

Returns a string that represents the current object.

(Inherited from Object)

Applies to

See also