Método EditPoint.PadToColumn

Preenche a linha atual no buffer com caracteres vazios (espaço branco) na coluna fornecida.

Namespace:  EnvDTE
Assembly:  EnvDTE (em EnvDTE.dll)

Sintaxe

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

Parâmetros

  • Column
    Tipo: System.Int32
    Obrigatório.O número de colunas para acrescentar, começando em um.

Comentários

PadToColumnInserções de tabulações e espaços, de acordo com as configurações globais, do ponto de edição ou da seleção para exibem a coluna para a coluna de exibição especificado. Se o ponto de edição ou o final ativo da seleção já se encontra além da coluna especificada, PadToColumn não faz nada.

Exemplos

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

Segurança do .NET Framework

Consulte também

Referência

EditPoint Interface

Namespace EnvDTE

Outros recursos

Como: compilar e Executar a automação de exemplos de Código do modelo de objeto