Share via


IAsyncPersistFileFormat.SaveAsync Method

Definition

Saves a copy of the object to the specified file, asynchronously.

public Microsoft.VisualStudio.Shell.Interop.IVsTask SaveAsync (string filename, bool remember, uint formatIndex, Microsoft.VisualStudio.Shell.Interop.IVsProgress? progress);
abstract member SaveAsync : string * bool * uint32 * Microsoft.VisualStudio.Shell.Interop.IVsProgress -> Microsoft.VisualStudio.Shell.Interop.IVsTask
Public Function SaveAsync (filename As String, remember As Boolean, formatIndex As UInteger, progress As IVsProgress) As IVsTask

Parameters

filename
String

The file name. This parameter can be null, in which case the object is saved to its current file. If the object is in the untitled state and filename is null, ArgumentException is thrown.

remember
Boolean

Indicates whether filename is to be used as the current working file. If true, filename becomes the current file and the object should clear its dirty flag after the save. If false, this save operation is a Save a Copy As operation. In this case, the current file is unchanged and the object does not clear its dirty flag. If filename is null, remember is ignored.

formatIndex
UInt32

A value that indicates the format in which the file will be saved. The caller passes DEF_FORMAT_INDEX if the object is to choose its default (current) format. Otherwise, the value is interpreted as the index into the list of formats, as returned by a call to the GetFormatList(String) method. An index value of 0 indicates the first format, 1 the second format, and so on.

progress
IVsProgress

The interface through which progress is reported.

Returns

A task representing the asynchronous operation. The result of the returned task will be IVsAsyncSaveResult. The FileName property is unused.

Remarks

Implementers should be prepared for this method to be called on any thread.

Applies to