Share via


IVsaPersistSite.SaveElement Method

Saves an arbitrary source string with a given name parameter, which can then be used in a call to the IVsaPersistSite.LoadElement method to reload the string.

public: void SaveElement( 
   String*  Name,
   String*  Source
);
public void SaveElement( 
   string  Name,
   string  Source
);
MustOverride Public Sub SaveElement( _ 
   ByVal  Name As String, _
   ByVal  Source As String _
)

Parameters

  • name
    A name to associate with the specified source item. This can be a null reference when saving the Project file..

  • source
    The source string for the item.

Remarks

Engines call back to this host-implemented method when the host calls the IVsaEngine.LoadSourceState method.

The name parameter must be a valid name or a null reference.

The following table shows the exceptions that the SaveElement method can throw.

Exception Type

Condition

ElementNameInvalid

The element name is not valid, for example, it contains characters that are not valid.

CallbackUnexpected

The call was made outside of a call to the IVsaEngine.SaveSourceState method.

SaveElementFailed

The element failed to save. Check System.InnerException for more information.

See Also

Reference

IVsaPersistSite Interface