MenuBindingsEditor 类

定义

为关联的 DataBindings 控件的 Menu 集合提供组件编辑器。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
继承
MenuBindingsEditor

示例

下面的代码示例演示如何使用 EditorAttribute 属性将 MenuBindingsEditor 类和 UITypeEditor 类 (绑定编辑器基类) 与从类派生的自定义控件中的属性, WebControl 用于获取和设置 MenuItemCollection 集合。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

注解

MenuBindingsEditor类提供一个用户界面,用于在 MenuItemBinding 关联的 DataBindings 控件中编辑集合的元素 MenuThe MenuBindingsEditor class provides a user interface for editing the MenuItemBinding elements of the DataBindings collection within the associated Menu control.

MenuBindingsEditor通过在可视化设计器的 "属性" 网格中选择 "databinding" ( ... ") " 按钮,或者从控件上的 "公共任务" 上下文菜单中选择 "编辑菜单项" 来调用对象。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.

EditValue方法编辑关联控件的数据绑定集合的值 MenuThe EditValue method edits the values of the data bindings collection of the associated Menu control. GetEditStyle方法可获取与此编辑器关联的编辑样式。The GetEditStyle method gets the editing style that is associated with this editor.

构造函数

MenuBindingsEditor()

初始化 MenuBindingsEditor 类的新实例。Initializes a new instance of the MenuBindingsEditor class.

属性

IsDropDownResizable

获取一个值,该值指示是否应由用户调整下拉编辑器的大小。Gets a value indicating whether drop-down editors should be resizable by the user.

(继承自 UITypeEditor)

方法

EditValue(IServiceProvider, Object)

使用 GetEditStyle() 方法所指示的编辑器样式编辑指定对象的值。Edits the value of the specified object using the editor style indicated by the GetEditStyle() method.

(继承自 UITypeEditor)
EditValue(ITypeDescriptorContext, IServiceProvider, Object)

编辑关联的 Menu 控件的数据绑定集合的值。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.

(继承自 Object)
GetEditStyle()

获取由 EditValue(IServiceProvider, Object) 方法使用的编辑器样式。Gets the editor style used by the EditValue(IServiceProvider, Object) method.

(继承自 UITypeEditor)
GetEditStyle(ITypeDescriptorContext)

获取与此编辑器关联的编辑样式。Gets the editing style that is associated with this editor.

GetHashCode()

作为默认哈希函数。Serves as the default hash function.

(继承自 Object)
GetPaintValueSupported()

指示该编辑器是否支持绘制对象值的表示形式。Indicates whether this editor supports painting a representation of an object's value.

(继承自 UITypeEditor)
GetPaintValueSupported(ITypeDescriptorContext)

指示指定的上下文是否支持在指定的上下文内绘制对象值的表示形式。Indicates whether the specified context supports painting a representation of an object's value within the specified context.

(继承自 UITypeEditor)
GetType()

获取当前实例的 TypeGets the Type of the current instance.

(继承自 Object)
MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(继承自 Object)
PaintValue(Object, Graphics, Rectangle)

将指定对象值表示形式绘制到指定的画布上。Paints a representation of the value of the specified object to the specified canvas.

(继承自 UITypeEditor)
PaintValue(PaintValueEventArgs)

使用指定的 PaintValueEventArgs 绘制某个对象的值的表示形式。Paints a representation of the value of an object using the specified PaintValueEventArgs.

(继承自 UITypeEditor)
ToString()

返回表示当前对象的字符串。Returns a string that represents the current object.

(继承自 Object)

适用于

另请参阅