ListItemsCollectionEditor 类

定义

为从 ListItemCollection 或相似控件派生的控件中的 ListControl 对象提供组件编辑器。

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

示例

下面的代码示例演示如何使用EditorAttribute类将类和UITypeEditor类 (集合编辑器的基类) 与自定义ListItems属性相关联ListItemsCollectionEditor

private ListItemCollection items = null;

// Associate the ListItemsCollectionEditor with the ListItems. 
[EditorAttribute(typeof(System.Web.UI.Design.WebControls.
   ListItemsCollectionEditor),
   typeof(UITypeEditor))]
public ListItemCollection ListItems
{
    get { return items; }
} // ListItems
Private items As ListItemCollection

' Associate the ListItemsCollectionEditor with the ListItems.
<EditorAttribute( GetType(System.Web.UI.Design.WebControls. _
    ListItemsCollectionEditor), _
    GetType(UITypeEditor))> _
Public ReadOnly Property ListItems() As ListItemCollection
    Get
        Return items
    End Get
End Property ' ListItems

注解

ListItemsCollectionEditor类提供一个用户界面,用于编辑ListItem派生自ListControl或类似控件的ListItemCollection控件中的对象的元素。

ListItemsCollectionEditor通过在视觉设计器 的属性网格中的 ListItems 属性上选择省略号 (...) 按钮来调用该省略号。

该方法 CanSelectMultipleInstances 始终返回 false 以指示在编辑器中一次只能选择一个对象。 该 HelpTopic 属性返回编辑器显示的帮助主题的名称。

构造函数

ListItemsCollectionEditor(Type)

初始化 ListItemsCollectionEditor 类的新实例。

属性

CollectionItemType

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

(继承自 CollectionEditor)
CollectionType

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

(继承自 CollectionEditor)
Context

获取指示当前上下文的类型说明符。

(继承自 CollectionEditor)
HelpTopic

获取要为 ListItemsCollectionEditor 对象显示的帮助主题。

HelpTopic

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

(继承自 CollectionEditor)
IsDropDownResizable

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

(继承自 UITypeEditor)
NewItemTypes

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

(继承自 CollectionEditor)

方法

CancelChanges()

取消对集合的更改。

(继承自 CollectionEditor)
CanRemoveInstance(Object)

指示是否可以移除集合的初始成员。

(继承自 CollectionEditor)
CanSelectMultipleInstances()

获取指示是否可以一次选择多个 ListItem 元素的值。

CreateCollectionForm()

创建新的窗体,以显示和编辑当前集合。

(继承自 CollectionEditor)
CreateCollectionItemType()

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

(继承自 CollectionEditor)
CreateInstance(Type)

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

(继承自 CollectionEditor)
CreateNewItemTypes()

获取此集合编辑器可包含的数据类型。

(继承自 CollectionEditor)
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)

适用于

另请参阅