DesignerRegionCollection Class

Definition

表示控件设计器中 DesignerRegion 对象的集合。Represents a collection of DesignerRegion objects within a control designer.

public ref class DesignerRegionCollection : System::Collections::IList
public class DesignerRegionCollection : System.Collections.IList
type DesignerRegionCollection = class
    interface IList
    interface ICollection
    interface IEnumerable
Public Class DesignerRegionCollection
Implements IList
Inheritance
DesignerRegionCollection
Implements

Remarks

ControlDesigner 类和任何派生类都使用 DesignerRegionCollection 类在设计宿主(如 Visual Studio 2005Visual Studio 2005)中包含和枚举控件的设计器区域。The ControlDesigner class, and any derived class, uses the DesignerRegionCollection class to contain and enumerate the designer regions for the control in a design host, such as Visual Studio 2005Visual Studio 2005.

例如,ControlDesigner.GetDesignTimeHtml 方法可用于定义区域并将其添加到集合中。For example, the ControlDesigner.GetDesignTimeHtml method can be used to define and add regions to the collection.

使用 Owner 属性访问包含设计器区域集合的控件设计器对象。Use the Owner property to access the control designer object that contains the designer region collection. 使用 DesignerRegionCollection 方法和属性来检查和维护集合中的 DesignerRegion 对象。Use the DesignerRegionCollection methods and properties to examine and maintain the DesignerRegion objects that are in the collection.

添加对象时,集合会动态增加。The collection dynamically increases as objects are added. 此集合中的索引从零开始。Indexes in this collection are zero-based. 使用 Count 属性来确定集合中有多少设计器区域。Use the Count property to determine how many designer regions are in the collection. 使用 DesignerRegionCollection 成员提供以下功能:Use the DesignerRegionCollection members to provide the following functionality:

  • 用于向集合添加单个设计器区域的 Add 方法。The Add method to add a single designer region to the collection.

  • 用于在集合中的特定索引处添加设计器区域的 Insert 方法。The Insert method to add a designer region at a particular index within the collection.

  • 用于移除设计器区域的 Remove 方法。The Remove method to remove a designer region.

  • 用于移除特定索引处的设计器区域的 RemoveAt 方法。The RemoveAt method to remove the designer region at a particular index.

  • 用于确定特定设计器区域是否已存在于集合中的 Contains 方法。The Contains method to determine whether a particular designer region is already in the collection.

  • 用于检索集合中设计器区域的索引的 IndexOf 方法。The IndexOf method to retrieve the index of a designer region within the collection.

  • 用于获取或设置特定索引处的设计器区域(使用数组表示法)的 Item[] 索引器。The Item[] indexer to get or set the designer region at a particular index, using array notation.

  • 要从集合中移除所有设计器区域的 Clear 方法。The Clear method to remove all designer regions from the collection.

Constructors

DesignerRegionCollection()

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

DesignerRegionCollection(ControlDesigner)

为指定的控件设计器初始化 DesignerRegionCollection 类的新实例。Initializes a new instance of the DesignerRegionCollection class for the specified control designer.

Properties

Count

获取集合中 DesignerRegion 对象的数量。Gets the number of DesignerRegion objects in the collection.

IsFixedSize

获取一个值,该值指示 DesignerRegionCollection 对象是否具有固定大小。Gets a value indicating whether the DesignerRegionCollection object has a fixed size.

IsReadOnly

获取一个值,该值指示 DesignerRegionCollection 对象是否为只读。Gets a value indicating whether the DesignerRegionCollection object is read-only.

IsSynchronized

获取一个值,该值指示对 DesignerRegionCollection 对象的访问是否同步(线程安全)。Gets a value indicating whether access to the DesignerRegionCollection object is synchronized (thread safe).

Item[Int32]

获取或设置集合中指定索引处的 DesignerRegion 对象。Gets or sets a DesignerRegion object at the specified index in the collection.

Owner

获取具有设计器区域集合的控件设计器。Gets the control designer that owns the designer region collection.

SyncRoot

获取一个对象,该对象可用于同步对 DesignerRegionCollection 对象的访问。Gets an object that can be used to synchronize access to the DesignerRegionCollection object.

Methods

Add(DesignerRegion)

将指定的 DesignerRegion 对象添加到集合末尾。Adds the specified DesignerRegion object to the end of the collection.

Clear()

从集合中移除所有区域。Removes all regions from the collection.

Contains(DesignerRegion)

获取指示集合中是否包含指定区域的值。Gets a value indicating whether the specified region is contained within the collection.

CopyTo(Array, Int32)

从特定的 Array 索引开始,将集合的元素复制到 Array 对象。Copies the elements of the collection to an Array object, starting at a particular Array index.

Equals(Object)

确定指定的对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetEnumerator()

返回一个循环访问集合的枚举器。Returns an enumerator that iterates through the collection.

GetHashCode()

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

(Inherited from Object)
GetType()

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

(Inherited from Object)
IndexOf(DesignerRegion)

返回指定的 DesignerRegion 对象在集合中的索引。Returns the index of the specified DesignerRegion object within the collection.

Insert(Int32, DesignerRegion)

DesignerRegion 对象插入到集合中的指定索引处。Inserts a DesignerRegion object into the collection at the specified index.

MemberwiseClone()

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

(Inherited from Object)
Remove(DesignerRegion)

从集合中移除指定的 DesignerRegion 对象。Removes the specified DesignerRegion object from the collection.

RemoveAt(Int32)

移除集合中指定索引处的 DesignerRegion 对象。Removes the DesignerRegion object at the specified index within the collection.

ToString()

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

(Inherited from Object)

Explicit Interface Implementations

ICollection.CopyTo(Array, Int32)

有关此成员的说明,请参见 CopyTo(Array, Int32)For a description of this member, see CopyTo(Array, Int32).

ICollection.Count

有关此成员的说明,请参见 CountFor a description of this member, see Count.

ICollection.IsSynchronized

有关此成员的说明,请参见 IsSynchronizedFor a description of this member, see IsSynchronized.

ICollection.SyncRoot

有关此成员的说明,请参见 SyncRootFor a description of this member, see SyncRoot.

IEnumerable.GetEnumerator()

有关此成员的说明,请参见 GetEnumerator()For a description of this member, see GetEnumerator().

IList.Add(Object)

有关此成员的说明,请参见 Add(Object)For a description of this member, see Add(Object).

IList.Clear()

有关此成员的说明,请参见 Clear()For a description of this member, see Clear().

IList.Contains(Object)

有关此成员的说明,请参见 Contains(Object)For a description of this member, see Contains(Object).

IList.IndexOf(Object)

有关此成员的说明,请参见 IndexOf(Object)For a description of this member, see IndexOf(Object).

IList.Insert(Int32, Object)

有关此成员的说明,请参见 Insert(Int32, Object)For a description of this member, see Insert(Int32, Object).

IList.IsFixedSize

有关此成员的说明,请参见 IsFixedSizeFor a description of this member, see IsFixedSize.

IList.IsReadOnly

有关此成员的说明,请参见 IsReadOnlyFor a description of this member, see IsReadOnly.

IList.Item[Int32]

有关此成员的说明,请参见 Item[Int32]For a description of this member, see Item[Int32].

IList.Remove(Object)

有关此成员的说明,请参见 Remove(Object)For a description of this member, see Remove(Object).

IList.RemoveAt(Int32)

有关此成员的说明,请参见 RemoveAt(Int32)For a description of this member, see RemoveAt(Int32).

Extension Methods

Cast<TResult>(IEnumerable)

IEnumerable 的元素强制转换为指定的类型。Casts the elements of an IEnumerable to the specified type.

OfType<TResult>(IEnumerable)

根据指定类型筛选 IEnumerable 的元素。Filters the elements of an IEnumerable based on a specified type.

AsParallel(IEnumerable)

启用查询的并行化。Enables parallelization of a query.

AsQueryable(IEnumerable)

IEnumerable 转换为 IQueryableConverts an IEnumerable to an IQueryable.

Applies to

See also