DesignerAutoFormatCollection.Add(DesignerAutoFormat) 메서드

정의

지정된 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 사용합니다.

적용 대상

추가 정보