HtmlTextWriter.OutputTabs Méthode

Définition

Écrit une série de tabulations représentant le niveau de mise en retrait d'une ligne de caractères de balisage.

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

Exemples

L’exemple de code suivant montre comment remplacer la OutputTabs méthode dans une classe dérivée de la HtmlTextWriter classe . Le OutputTabs remplacement utilise toujours la DefaultTabString constante pour effectuer la mise en retrait.

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

Remarques

La OutputTabs méthode utilise la Indent propriété pour déterminer le nombre de chaînes de tabulation à écrire pour obtenir la mise en retrait souhaitée.

La chaîne de tabulation est spécifiée avec le HtmlTextWriter constructeur. Si aucune chaîne de tabulation n’est spécifiée, la DefaultTabString constante (\t) est utilisée.

S’applique à

Voir aussi