In This Article

IIndentProvider Interface

Provides the base requirements of an object that indicates how text should be indented when the end user presses Enter.

public interface IIndentProvider

Remarks

This interface type can be registered with an ISyntaxLanguage using the RegisterService(object, object) method. Once an object that implements this interface is registered with the language for this interface type, its features can be used by the language.

Properties

Mode

Gets the IndentMode that specifies the mode by which to indent text.

IndentMode Mode { get; }

Property Value

IndentMode:

The IndentMode that specifies the mode by which to indent text.

Methods

GetIndentAmount(TextSnapshotOffset, int)

Returns the ideal amount of indent, always in columns, for the line containing the snapshot offset.

int GetIndentAmount(TextSnapshotOffset snapshotOffset, int defaultAmount)
Parameter Type Description
snapshotOffset TextSnapshotOffset

The TextSnapshotOffset whose line should be examined.

defaultAmount int

The default indent amount, which is the amount used in Block mode.

Returns

int:

The ideal amount of indent, always in columns, for the line containing the snapshot offset.

Remarks

This method is called when the IndentMode is Smart. The containing ITextDocument is accessible via the snapshot range's ITextSnapshot.