Share via


IVsaCodeItem.SourceText Property

Sets or gets the text of a specified code item, including auto-generated code, if any.

public: __property String* get_SourceText(); 
public: __property void set_SourceText(String* value); 
public string SourceText {get; set;}
Property Get SourceText() As String 
Public Property Let SourceText(ByVal value As String)

Return Value

Returns the source text of the code item.

Remarks

When you set this property, the text is not subjected to validation. For this reason, errors, if any, will surface on the next call to the IVsaEngine.Compile method.

The SourceText property returns the source text in one large string, including formatting characters such as carriage returns.

To get this property the engine must not be closed. To set this property the engine must not be closed, and the engine must not be running.

The following table shows the exceptions that the SourceText property can throw.

Exception Type

Condition

EngineClosed

The IVsaEngine.Close method has been called and the engine is closed.

EngineRunning

The engine is running.

See Also

Reference

IVsaCodeItem Interface

IVsaEngine.Compile Method