HtmlTextWriter.OutputTabs Método

Definição

Grava uma série de cadeias de caracteres de guia que representam o nível de recuo de uma linha de caracteres de marcação.

protected:
 virtual void OutputTabs();
protected virtual void OutputTabs ();
abstract member OutputTabs : unit -> unit
override this.OutputTabs : unit -> unit
Protected Overridable Sub OutputTabs ()

Exemplos

O exemplo de código a seguir mostra como substituir o OutputTabs método em uma classe derivada da HtmlTextWriter classe . A OutputTabs substituição sempre usa a DefaultTabString constante para executar o recuo.

// Override the OutputTabs method to set the tab to
// the number of spaces defined by the Indent variable.
virtual void OutputTabs() override
{
   
   // Output the DefaultTabString for the number
   // of times specified in the Indent property.
   for ( int i = 0; i < Indent; i++ )
      Write( DefaultTabString );
   __super::OutputTabs();
}
// Override the OutputTabs method to set the tab to
// the number of spaces defined by the Indent variable.      
protected override void OutputTabs()
{
    // Output the DefaultTabString for the number
    // of times specified in the Indent property.
    for (int i = 0; i < Indent; i++)
        Write(DefaultTabString);
    base.OutputTabs();
}
' Override the OutputTabs method to set the tab to
' the number of spaces defined by the Indent variable.   
Protected Overrides Sub OutputTabs()
    ' Output the DefaultTabString for the number
    ' of times specified in the Indent property.
    Dim i As Integer
    For i = 0 To Indent - 1
        Write(DefaultTabString)
    Next i
    MyBase.OutputTabs()
End Sub

Comentários

O OutputTabs método usa a Indent propriedade para determinar quantas cadeias de caracteres de guia gravar para obter o recuo desejado.

A cadeia de caracteres de tabulação é especificada com o HtmlTextWriter construtor . Se nenhuma cadeia de caracteres de tabulação for especificada, a DefaultTabString constante (\t) será usada.

Aplica-se a

Confira também