This documentation is archived and is not being maintained.

DesignerAutoFormatCollection Class

Represents a collection of DesignerAutoFormat objects within a control designer. This class cannot be inherited.

Namespace:  System.Web.UI.Design
Assembly:  System.Design (in System.Design.dll)

public ref class DesignerAutoFormatCollection sealed : IList, 
	ICollection, IEnumerable

The ControlDesigner class and any derived class defines the AutoFormats property as a DesignerAutoFormatCollection object. Control developers can override the AutoFormats property in a derived control designer, add custom automatic formatting styles, and return the collection of supported formats to the visual designer.

The collection dynamically increases as objects are added. Indexes in this collection are zero-based. Use the Count property to determine how many automatic style formats are in the collection.

Additionally, use the DesignerAutoFormatCollection methods and properties to provide the following functionality:

  • The Add method to add a single format to the collection.

  • The Insert method to add a format at a particular index within the collection.

  • The Remove method to remove a format.

  • The RemoveAt method to remove the format at a particular index.

  • The Contains method to determine whether a particular format is already in the collection.

  • The IndexOf method to retrieve the index of a format within the collection.

  • The Item property to get or set the format at a particular index, using array notation.

  • The Clear method to remove all formats from the collection.

  • The Count property to determine the number of formats in the collection.

  • The IndexOf method to get the position of a format within the collection.

The following code example demonstrates how to implement the AutoFormats property in a custom control designer. The derived control designer implements the AutoFormats property by adding three instances of a custom automatic format that are derived from the DesignerAutoFormat class.

No code example is currently available or this language may not be supported.

System::Object
  System.Web.UI.Design::DesignerAutoFormatCollection

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0, 2.0
Show: