语言

MenuItemStyleCollectionEditor 类

定义

为关联MenuItemStyleCollection控件中的对象提供组件编辑器Menu。

public ref class MenuItemStyleCollectionEditor : System::ComponentModel::Design::CollectionEditor
public class MenuItemStyleCollectionEditor : System.ComponentModel.Design.CollectionEditor
type MenuItemStyleCollectionEditor = class
    inherit CollectionEditor
Public Class MenuItemStyleCollectionEditor
Inherits CollectionEditor
继承
MenuItemStyleCollectionEditor

示例

下面的代码示例演示如何使用EditorAttribute特性将类MenuItemStyleCollectionEditor(集合编辑器基类)与从UITypeEditor类派生的自定义控件中的属性相关联WebControl并设置MenuItemStyleCollection集合。

private MenuItemStyleCollection menuItemStyles;

// Associate the MenuItemStyleCollectionEditor with the 
// LevelMenuItemStyles. 
[Editor(typeof(System.Web.UI.Design.WebControls.
    MenuItemStyleCollectionEditor),
    typeof(UITypeEditor))]
public MenuItemStyleCollection LevelMenuItemStyles
{
    get { return menuItemStyles; }
    set { menuItemStyles = value; }
} // LevelMenuItemStyles
Private menuItemStyles As MenuItemStyleCollection

' Associate the MenuItemStyleCollectionEditor with the 
' LevelMenuItemStyles.
<EditorAttribute( GetType(System.Web.UI.Design.WebControls. _
    MenuItemStyleCollectionEditor), _
    GetType(UITypeEditor))> _
Public Property LevelMenuItemStyles() As MenuItemStyleCollection
    Get
        Return menuItemStyles
    End Get
    Set
        menuItemStyles = value
    End Set
End Property ' LevelMenuItemStyles

注解

该MenuItemStyleCollectionEditor类提供一个用户界面,用于在设计时编辑MenuItemStyle关联MenuItemStyleCollection控件中对象元素Menu,该控件位于对象的控件MenuDesigner下。

控件的每个MenuItemStyleCollection属性LevelMenuItemStyles都有LevelSelectedStyles一个Menu关联。 这些 MenuItemStyleCollection 对象用于将样式应用于菜单结构中依赖于其级别(嵌套深度)的菜单项。

MenuItemStyleCollectionEditor例如,通过在视觉设计器的“属性”网格中选择 LevelMenuItemStyles 或 LevelSelectedStyles 行上的省略号按钮(...),来调用该按钮。

该方法 CanSelectMultipleInstances 始终返回 false 以指示在编辑器中一次只能选择一个对象。 该方法 CreateCollectionForm 创建一个新窗体来显示和编辑当前 MenuItemStyleCollection窗体。

该方法 CreateInstance 创建指定集合项类型的新实例。 该方法 CreateNewItemTypes 返回编辑器可以创建的类型的数组。

构造函数

名称 说明
MenuItemStyleCollectionEditor(Type)

初始化 MenuItemStyleCollectionEditor 类的新实例。

属性

名称 说明
CollectionItemType

获取集合中每个项的数据类型。

(继承自 CollectionEditor)
CollectionType

获取集合对象的数据类型。

(继承自 CollectionEditor)
Context

获取指示当前上下文的类型描述符。

(继承自 CollectionEditor)
HelpTopic

获取帮助关键字,以便在按下编辑器对话框“帮助”按钮或 F1 键时显示帮助主题或主题列表。

(继承自 CollectionEditor)
IsDropDownResizable

获取一个值,该值指示用户是否应调整下拉列表编辑器的大小。

(继承自 UITypeEditor)
NewItemTypes

获取可为此集合创建的可用项类型。

(继承自 CollectionEditor)

方法

名称 说明
CancelChanges()

取消对集合的更改。

(继承自 CollectionEditor)
CanRemoveInstance(Object)

指示是否可以删除集合的原始成员。

(继承自 CollectionEditor)
CanSelectMultipleInstances()

获取一个值,该值指示是否可以一次在编辑器中选择多个 MenuItemStyle 元素。

CreateCollectionForm()

创建一个新窗体以显示和编辑当前 MenuItemStyleCollection 对象。

CreateCollectionItemType()

获取此集合包含的数据类型。

(继承自 CollectionEditor)
CreateInstance(Type)

创建指定集合项类型的新实例。

CreateNewItemTypes()

获取此集合编辑器可以创建的数据类型。

DestroyInstance(Object)

销毁对象的指定实例。

(继承自 CollectionEditor)
EditValue(IServiceProvider, Object)

使用方法指示 GetEditStyle() 的编辑器样式编辑指定对象的值。

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

使用指定的服务提供程序和上下文编辑指定对象的值。

(继承自 CollectionEditor)
Equals(Object)

确定指定的对象是否等于当前对象。

(继承自 Object)
GetDisplayText(Object)

检索给定列表项的显示文本。

(继承自 CollectionEditor)
GetEditStyle()

获取方法使用的 EditValue(IServiceProvider, Object) 编辑器样式。

(继承自 UITypeEditor)
GetEditStyle(ITypeDescriptorContext)

获取方法使用的 EditValue(ITypeDescriptorContext, IServiceProvider, Object) 编辑样式。

(继承自 CollectionEditor)
GetHashCode()

用作默认哈希函数。

(继承自 Object)
GetItems(Object)

获取包含指定集合的对象数组。

(继承自 CollectionEditor)
GetObjectsFromInstance(Object)

返回包含给定对象的列表。

(继承自 CollectionEditor)
GetPaintValueSupported()

指示此编辑器是否支持绘制对象的值的表示形式。

(继承自 UITypeEditor)
GetPaintValueSupported(ITypeDescriptorContext)

指示指定上下文是否支持在指定上下文中绘制对象的值的表示形式。

(继承自 UITypeEditor)
GetService(Type)

获取请求的服务(如果可用)。

(继承自 CollectionEditor)
GetType()

获取当前实例的 Type。

(继承自 Object)
MemberwiseClone()

创建当前 Object的浅表副本。

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

将指定对象的值的表示形式绘制到指定的画布。

(继承自 UITypeEditor)
PaintValue(PaintValueEventArgs)

使用指定的 PaintValueEventArgs对象值绘制表示形式。

(继承自 UITypeEditor)
SetItems(Object, Object[])

将指定的数组设置为集合的项。

(继承自 CollectionEditor)
ShowHelp()

显示集合编辑器的默认帮助主题。

(继承自 CollectionEditor)
ToString()

返回一个表示当前对象的字符串。

(继承自 Object)

适用于

另请参阅