MenuItemStyleCollectionEditor 类
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
为关联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
- 继承
示例
下面的代码示例演示如何使用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) |