HtmlTextWriter.OutputTabs Metoda

Definicja

Zapisuje serię ciągów tabulacji reprezentujących poziom wcięcia dla linii znaków znaczników.

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

Przykłady

W poniższym przykładzie kodu pokazano, jak zastąpić metodę OutputTabs w klasie pochodzącej HtmlTextWriter z klasy. Przesłonięcie OutputTabs zawsze używa stałej DefaultTabString do wykonania wcięcia.

// 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

Uwagi

Metoda OutputTabs używa właściwości , Indent aby określić liczbę ciągów tabulacji do zapisania w celu uzyskania żądanego wcięcia.

Ciąg tabulatora jest określony za pomocą konstruktora HtmlTextWriter . Jeśli nie określono ciągu tabulatora DefaultTabString , używana jest stała (\t).

Dotyczy

Zobacz też