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, Int32)
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 | Int32 | The default indent amount, which is the amount used in |
Returns
- Int32:
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.