Share via


XamlLanguageService.FormatSource Method

This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.

Using ISourceChanger for IMarkupSourceProvider, formats the file based on the specified formatting options.

Namespace:  Microsoft.Xaml
Assembly:  Microsoft.Windows.Design.Markup (in Microsoft.Windows.Design.Markup.dll)

Syntax

'Declaration
Public Shared Function FormatSource ( _
    source As IMarkupSourceProvider, _
    offset As Integer, _
    length As Integer, _
    options As FormattingOptions, _
    indentText As String, _
    tabWidth As Integer, _
    margin As Integer _
) As SemanticRange
'Usage
Dim source As IMarkupSourceProvider 
Dim offset As Integer 
Dim length As Integer 
Dim options As FormattingOptions 
Dim indentText As String 
Dim tabWidth As Integer 
Dim margin As Integer 
Dim returnValue As SemanticRange 

returnValue = XamlLanguageService.FormatSource(source, _
    offset, length, options, indentText, _
    tabWidth, margin)
public static SemanticRange FormatSource(
    IMarkupSourceProvider source,
    int offset,
    int length,
    FormattingOptions options,
    string indentText,
    int tabWidth,
    int margin
)
public:
static SemanticRange FormatSource(
    IMarkupSourceProvider^ source, 
    int offset, 
    int length, 
    FormattingOptions options, 
    String^ indentText, 
    int tabWidth, 
    int margin
)
public static function FormatSource(
    source : IMarkupSourceProvider, 
    offset : int, 
    length : int, 
    options : FormattingOptions, 
    indentText : String, 
    tabWidth : int, 
    margin : int
) : SemanticRange

Parameters

Return Value

Type: Microsoft.Xaml.SemanticRange
The updated offset and length in a SemanticRange.

Remarks

If offset is 0 and length is -1, the entire file will be formatted.

.NET Framework Security

See Also

Reference

XamlLanguageService Class

XamlLanguageService Members

Microsoft.Xaml Namespace

Other Resources

WPF Designer Extensibility