Source::SetText Method (Int32, Int32, Int32, Int32, String^)

 

Replaces the specified section of source with the given text.

Namespace:   Microsoft.VisualStudio.Package
Assembly:  Microsoft.VisualStudio.Package.LanguageService.14.0 (in Microsoft.VisualStudio.Package.LanguageService.14.0.dll)

public:
void SetText(
	int startLine,
	int startCol,
	int endLine,
	int endCol,
	String^ newText
)

Parameters

startLine
Type: System::Int32

The first line of source to replace.

startCol
Type: System::Int32

The beginning offset of the first character on the first line to replace.

endLine
Type: System::Int32

The last line of source to replace.

endCol
Type: System::Int32

The last character offset on the last line to replace.

newText
Type: System::String^

The new text.

This method validates the input range, then calls the ReplaceLines method to replace the specified section with the new text.

If newText is a null value, then the given span is deleted.

This method can throw an exception if there was an error.

Return to top
Show: