This documentation is archived and is not being maintained.

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.

[Visual Basic]
Sub SaveElement( _
   ByVal name As String, _
   ByVal source As String _
void SaveElement(
   string name,
 string source
void SaveElement(
   String* name,
 String* source
function SaveElement(
   name : String,
 source : String


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


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.


Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

IVsaPersistSite Interface | IVsaPersistSite Members | Microsoft.Vsa Namespace