Udostępnij za pośrednictwem


Metoda EditPoint2.PadToColumn — (Int32)

Wstawia puste znaki (światło) w danej kolumnie bieżącego wiersza w buforze.

Przestrzeń nazw:  EnvDTE80
Zestaw:  EnvDTE80 (w EnvDTE80.dll)

Składnia

'Deklaracja
Sub PadToColumn ( _
    Column As Integer _
)
void PadToColumn(
    int Column
)
void PadToColumn(
    [InAttribute] int Column
)
abstract PadToColumn : 
        Column:int -> unit 
function PadToColumn(
    Column : int
)

Parametry

  • Column
    Typ: System.Int32
    Wymagane.Liczba kolumn do pad, począwszy od jednego.

Uwagi

PadToColumnWstawia w znaki tabulacji i spacje, zgodnie z ustawienia globalne, Edycja punktu lub zaznaczenia można wyświetlić kolumnę do wyświetlania określonej kolumny.Jeśli edytowany punkt lub active końca zaznaczenia już leży poza określona kolumna PadToColumn nic nie robi.

Przykłady

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 ten 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 ten 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();
    }
}

Zabezpieczenia programu .NET Framework

Zobacz też

Informacje

EditPoint2 Interfejs

Przeciążenie PadToColumn

Przestrzeń nazw EnvDTE80

Inne zasoby

Jak: skompilować i uruchomić przykłady kodu modelu obiektu automatyzacji