Compartir a través de


Source.SetText Method (String)

Replaces the source contents with the given text.

Namespace:  Microsoft.VisualStudio.Package
Assemblies:   Microsoft.VisualStudio.Package.LanguageService.12.0 (in Microsoft.VisualStudio.Package.LanguageService.12.0.dll)
  Microsoft.VisualStudio.Package.LanguageService.10.0 (in Microsoft.VisualStudio.Package.LanguageService.10.0.dll)
  Microsoft.VisualStudio.Package.LanguageService.11.0 (in Microsoft.VisualStudio.Package.LanguageService.11.0.dll)
  Microsoft.VisualStudio.Package.LanguageService.9.0 (in Microsoft.VisualStudio.Package.LanguageService.9.0.dll)
  Microsoft.VisualStudio.Package.LanguageService (in Microsoft.VisualStudio.Package.LanguageService.dll)

Syntax

'Declaration
Public Sub SetText ( _
    newText As String _
)
public void SetText(
    string newText
)
public:
void SetText(
    String^ newText
)
member SetText : 
        newText:string -> unit
public function SetText(
    newText : String
)

Parameters

  • newText
    Type: String

    The 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.

.NET Framework Security

See Also

Reference

Source Class

SetText Overload

Microsoft.VisualStudio.Package Namespace