다음을 통해 공유


EditPoint.PadToColumn 메서드

버퍼의 현재 줄을 지정한 열까지 빈 문자(공백)로 채웁니다.

네임스페이스:  EnvDTE
어셈블리:  EnvDTE(EnvDTE.dll)

구문

‘선언
Sub PadToColumn ( _
    Column As Integer _
)
void PadToColumn(
    int Column
)
void PadToColumn(
    [InAttribute] int Column
)
abstract PadToColumn : 
        Column:int -> unit 
function PadToColumn(
    Column : int
)

매개 변수

  • Column
    형식: System.Int32
    필수 요소.1에서 시작하여 채워질 열 수입니다.

설명

PadToColumn은 전역 설정에 따라 편집 지점 또는 선택 영역의 표시 열부터 지정된 표시 열까지 탭과 공백을 삽입합니다.편집 지점이나 선택 영역의 활성 끝점이 지정된 열을 넘은 경우 PadToColumn은 아무 것도 수행하지 않습니다.

예제

Sub PadToColumnExample(ByVal dte As DTE2)

    ' Create a new text file.
    dte.ItemOperations.NewFile()

    ' Create an EditPoint at the start of the new file.
    Dim doc As TextDocument = _
        CType(dte.ActiveDocument.Object("TextDocument"), TextDocument)
    Dim point As EditPoint = doc.StartPoint.CreateEditPoint
    Dim i As Integer

    ' Insert 10 lines of text.
    For i = 1 To 10
        point.Insert("This is a test." & vbCrLf)
    Next i

    point.StartOfDocument()

    ' Indent text to column 10.
    For i = 1 To 10
        point.PadToColumn(10)
        point.LineDown()
        point.StartOfLine()
    Next

End Sub
public void PadToColumnExample(DTE2 dte)
{
    // Create a new text file.
    dte.ItemOperations.NewFile(@"General\Text File", "", 
        Constants.vsViewKindPrimary);

    // Create an EditPoint at the start of the new file.
    TextDocument doc = 
        (TextDocument)dte.ActiveDocument.Object("TextDocument");
    EditPoint point = doc.StartPoint.CreateEditPoint();

    // Insert 10 lines of text.
    for (int i = 0; i < 10; i++)
        point.Insert("This is a test.\n");

    point.StartOfDocument();

    // Indent text to column 10.
    for (int i = 0; i < 10; i++)
    {
        point.PadToColumn(10);
        point.LineDown(1);
        point.StartOfLine();
    }
}

.NET Framework 보안

  • 직접 실행 호출자의 경우 완전히 신뢰합니다. 이 멤버는 부분적으로 신뢰할 수 있는 코드에서 사용할 수 없습니다. 자세한 내용은 부분 신뢰 코드에서 라이브러리 사용을 참조하십시오.

참고 항목

참조

EditPoint 인터페이스

EnvDTE 네임스페이스

기타 리소스

방법: 자동화 개체 모델 코드의 예제 컴파일 및 실행