IAsyncPersistFileFormat.SaveAsync Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
This method is safe to access from any thread.