TemplateGroupCollection Class
Represents a collection of TemplateGroup objects within a control designer. This class cannot be inherited.
Assembly: System.Design (in System.Design.dll)
The TemplateGroupCollection type exposes the following members.
| Name | Description | |
|---|---|---|
![]() | TemplateGroupCollection | Initializes a new instance of the TemplateGroupCollection class. |
| Name | Description | |
|---|---|---|
![]() | Count | Gets the number of TemplateGroup objects in the collection. |
![]() | Item | Gets or sets a TemplateGroup object at the specified index in the collection. |
| Name | Description | |
|---|---|---|
![]() | Add | Adds the specified TemplateGroup object to the end of the collection. |
![]() | AddRange | Adds the template groups in an existing TemplateGroupCollection object to the current TemplateGroupCollection object. |
![]() | Clear | Removes all groups from the collection. |
![]() | Contains | Determines whether the specified group is contained within the collection. |
![]() | CopyTo | Copies the groups in the collection to a compatible one-dimensional array, starting at the specified index of the target array. |
![]() | Equals(Object) | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) |
![]() | Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) |
![]() | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) |
![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() | IndexOf | Returns the index of the specified TemplateGroup object within the collection. |
![]() | Insert | Inserts a TemplateGroup object into the collection at the specified index. |
![]() | MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) |
![]() | Remove | Removes the specified TemplateGroup object from the collection. |
![]() | RemoveAt | Removes the TemplateGroup object at the specified index within the collection. |
![]() | ToString | Returns a string that represents the current object. (Inherited from Object.) |
| Name | Description | |
|---|---|---|
![]() | AsParallel | Enables parallelization of a query. (Defined by ParallelEnumerable.) |
![]() | AsQueryable | Converts an IEnumerable to an IQueryable. (Defined by Queryable.) |
![]() | Cast<TResult> | Converts the elements of an IEnumerable to the specified type. (Defined by Enumerable.) |
![]() | OfType<TResult> | Filters the elements of an IEnumerable based on a specified type. (Defined by Enumerable.) |
| Name | Description | |
|---|---|---|
![]() ![]() | ICollection::CopyTo | Infrastructure. For a description of this member, see CopyTo. |
![]() ![]() | ICollection::Count | Infrastructure. For a description of this member, see Count. |
![]() ![]() | ICollection::IsSynchronized | Infrastructure. For a description of this member, see IsSynchronized. |
![]() ![]() | ICollection::SyncRoot | Infrastructure. For a description of this member, see SyncRoot. |
![]() ![]() | IEnumerable::GetEnumerator | Infrastructure. For a description of this member, see GetEnumerator. |
![]() ![]() | IList::Add | Infrastructure. For a description of this member, see Add. |
![]() ![]() | IList::Clear | Infrastructure. For a description of this member, see Clear. |
![]() ![]() | IList::Contains | Infrastructure. For a description of this member, see Contains. |
![]() ![]() | IList::IndexOf | Infrastructure. For a description of this member, see IndexOf. |
![]() ![]() | IList::Insert | Infrastructure. For a description of this member, see Insert. |
![]() ![]() | IList::IsFixedSize | Infrastructure. For a description of this member, see IsFixedSize. |
![]() ![]() | IList::IsReadOnly | Infrastructure. For a description of this member, see IsReadOnly. |
![]() ![]() | IList::Item | Infrastructure. For a description of this member, see the IList class. |
![]() ![]() | IList::Remove | Infrastructure. For a description of this member, see Remove. |
![]() ![]() | IList::RemoveAt | Infrastructure. For a description of this member, see RemoveAt. |
The ControlDesigner class, and any derived class, defines the TemplateGroups property as a TemplateGroupCollection object. The TemplateGroupCollection property is typically used only by a design host such as Visual Studio 2005.
The collection dynamically increases in size as objects are added. Indexes in this collection are zero-based. Use the Count property to determine how many groups are in the collection.
Additionally, use the TemplateGroupCollection methods and properties to provide the following functionality:
The Add method to add a single group to the collection.
The Insert method to add a group at a particular index within the collection.
The Remove method to remove a group.
The RemoveAt method to remove the group at a particular index.
The Contains method to determine whether a particular group is already in the collection.
The IndexOf method to retrieve the index of a group within the collection.
The Item indexer to get or set the group at a particular index, using array notation.
The AddRange method to add multiple groups to the collection.
You can add multiple groups either as an array of groups or as a TemplateGroupCollection object that you retrieve through the TemplateGroups property of another control designer.
The Clear method to remove all groups from the collection.
The following code example demonstrates how to define a simple control designer that is derived from the ControlDesigner class. The derived control designer implements the TemplateGroups property by getting the template groups that are defined for the base class and adding a template group that is specific to the derived control designer.
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.






