Replaces the source contents with the given text.
Namespace: Microsoft.VisualStudio.Package
Assembly: Microsoft.VisualStudio.Package.LanguageService.9.0 (in Microsoft.VisualStudio.Package.LanguageService.9.0.dll)
Syntax
'宣言
Public Sub SetText ( _
newText As String _
)
'使用
Dim instance As Source
Dim newText As String
instance.SetText(newText)
public void SetText(
string newText
)
public:
void SetText(
String^ newText
)
public function SetText(
newText : String
)
Parameters
newText
Type: System.StringThe new text.
Remarks
This method calls the GetLastLineIndex method to get the last line and then calls the ReplaceLines method to replace all lines with the new text.
This method can throw an exception if there was an error.
Permissions
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.