EditPoint.DisplayColumn 속성

EditPoint 개체의 열 번호를 가져옵니다.

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

구문

‘선언
ReadOnly Property DisplayColumn As Integer
    Get
int DisplayColumn { get; }
property int DisplayColumn {
    int get ();
}
abstract DisplayColumn : int
function get DisplayColumn () : int

속성 값

형식: System.Int32
EditPoint 개체를 포함하는 현재 표시된 열의 번호입니다.

구현

TextPoint.DisplayColumn

설명

열 번호는 1부터 시작합니다. 줄에 탭 문자가 있으면 표시 열이 LineCharOffset 값과 다를 수 있습니다. DisplayColumn은 표시된 열을 확인할 때 탭 크기에 대한 전역 설정을 사용합니다.

예제

Sub DisplayColumnExample(ByVal dte As DTE2)

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

    ' Create an EditPoint at the start of the new document.
    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

    ' Display EditPoint properties.
    MsgBox( _
        "AbsoluteCharOffset: " & point.AbsoluteCharOffset & vbCrLf & _
        "DisplayColumn: " & point.DisplayColumn & vbCrLf & _
        "AtEndOfDocument: " & point.AtEndOfDocument & vbCrLf & _
        "AtEndOfLine: " & point.AtEndOfLine & vbCrLf & _
        "AtStartOfDocument: " & point.AtStartOfDocument & vbCrLf & _
        "AtStartOfLine: " & point.AtStartOfLine)

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

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

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

    // Display EditPoint properties.
    MessageBox.Show(
        "AbsoluteCharOffset: " + point.AbsoluteCharOffset + "\n" + 
        "DisplayColumn: " + point.DisplayColumn + "\n" + 
        "AtEndOfDocument: " + point.AtEndOfDocument + "\n" + 
        "AtEndOfLine: " + point.AtEndOfLine + "\n" + 
        "AtStartOfDocument: " + point.AtStartOfDocument + "\n" + 
        "AtStartOfLine: " + point.AtStartOfLine);
}

.NET Framework 보안

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

참고 항목

참조

EditPoint 인터페이스

DisplayColumn 오버로드

EnvDTE 네임스페이스

기타 리소스

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