DesignerAutoFormatCollection.Add(DesignerAutoFormat) Method
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Adds the specified DesignerAutoFormat object to the end of the collection.
public:
int Add(System::Web::UI::Design::DesignerAutoFormat ^ format);
public int Add(System.Web.UI.Design.DesignerAutoFormat format);
member this.Add : System.Web.UI.Design.DesignerAutoFormat -> int
Public Function Add (format As DesignerAutoFormat) As Integer
- format
- DesignerAutoFormat
An instance of DesignerAutoFormat.
The index at which the format was added to the collection.
The following code example illustrates how to create and add DesignerAutoFormat objects to the AutoFormats
property of a custom designer.
// The collection of AutoFormat objects for the IndentLabel object
public override DesignerAutoFormatCollection AutoFormats
{
get
{
if (_autoFormats == null)
{
// Create the collection
_autoFormats = new DesignerAutoFormatCollection();
// Create and add each AutoFormat object
_autoFormats.Add(new IndentLabelAutoFormat("MyClassic"));
_autoFormats.Add(new IndentLabelAutoFormat("MyBright"));
_autoFormats.Add(new IndentLabelAutoFormat("Default"));
}
return _autoFormats;
}
}
' The collection of AutoFormat objects for the IndentLabel object
Public Overrides ReadOnly Property AutoFormats() As DesignerAutoFormatCollection
Get
If _autoFormats Is Nothing Then
' Create the collection
_autoFormats = New DesignerAutoFormatCollection()
' Create and add each AutoFormat object
_autoFormats.Add(New IndentLabelAutoFormat("MyClassic"))
_autoFormats.Add(New IndentLabelAutoFormat("MyBright"))
_autoFormats.Add(New IndentLabelAutoFormat("Default"))
End If
Return _autoFormats
End Get
End Property
The Add method adds the specified DesignerAutoFormat object to the end of the collection. To add a DesignerAutoFormat object to the collection at a specific index location, use the Insert method.
Продукт | Версии |
---|---|
.NET Framework | 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
Обратна връзка за .NET
.NET е проект с отворен код. Изберете връзка, за да предоставите обратна връзка: