DesignerAutoFormatCollection.Add(DesignerAutoFormat) 메서드
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
지정된 DesignerAutoFormat 개체를 컬렉션의 끝에 추가합니다.
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
DesignerAutoFormat인스턴스입니다.
반품
형식이 컬렉션에 추가된 인덱스입니다.
예제
다음 코드 예제에서는 사용자 지정 디자이너의 속성에 개체를 DesignerAutoFormat 만들고 추가하는 AutoFormats 방법을 보여 줍니다.
// 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
설명
메서드는 Add 지정된 DesignerAutoFormat 개체를 컬렉션의 끝에 추가합니다. 특정 인덱스 DesignerAutoFormat 위치의 컬렉션에 개체를 추가하려면 메서드를 Insert 사용합니다.