Aracılığıyla paylaş


HtmlTextWriter.Indent Özellik

Tanım

Her işaretleme satırının başlangıcını girintili hale getirmek için sekme konumlarının sayısını alır veya ayarlar.

public:
 property int Indent { int get(); void set(int value); };
public int Indent { get; set; }
member this.Indent : int with get, set
Public Property Indent As Integer

Özellik Değeri

Her satırı girintili yapmak için sekme konumlarının sayısı.

Örnekler

Aşağıdaki kod örneği, öznitelikler bir <span> öğenin açılış etiketine Indent eklendiğinde ve RenderBeginTag yöntemi çağrıldığında özelliğine atanan değerin nasıl artırıldığını gösterir. Bu, öğesinin içinde işlenen tüm işaretlemeler için girintiyi <span> artırır.

// Set attributes and values along with attributes and styles  
// attribute defined for a <span> element.
writer.AddAttribute(HtmlTextWriterAttribute.Onclick, "alert('Hello');");
writer.AddAttribute("CustomAttribute", "CustomAttributeValue");
writer.AddStyleAttribute(HtmlTextWriterStyle.Color, "Red");
writer.AddStyleAttribute("Customstyle", "CustomStyleValue");
writer.RenderBeginTag(HtmlTextWriterTag.Span);
// Create a space and indent the markup inside the 
// <span> element.
writer.WriteLine();
writer.Indent++;
' Set attributes and values along with attributes and styles
' attribute defined for a <span> element.
writer.AddAttribute(HtmlTextWriterAttribute.Onclick, "alert('Hello');")
writer.AddAttribute("CustomAttribute", "CustomAttributeValue")
writer.AddStyleAttribute(HtmlTextWriterStyle.Color, "Red")
writer.AddStyleAttribute("CustomStyle", "CustomStyleValue")
writer.RenderBeginTag(HtmlTextWriterTag.Span)

'  Create a space and indent the markup inside the 
' <span> element.
writer.WriteLine()
writer.Indent += 1

Açıklamalar

Girintileme, oluşturucunun parametresi HtmlTextWriter(TextWriter, String) tarafından belirtilen dize özelliği tarafından tabString belirtilen sayıda yazılarak Indent gerçekleştirilir.

Indent Özellik negatif bir değere ayarlanırsa, kaydedilmeden önce 0 olarak değiştirilir.

Şunlara uygulanır

Ayrıca bkz.