Share via


IVsSolution3.CheckForAndSaveDeferredSaveSolution Method

Checks if the solution is in the deferred-save state.

Namespace:  Microsoft.VisualStudio.Shell.Interop
Assembly:  Microsoft.VisualStudio.Shell.Interop.8.0 (in Microsoft.VisualStudio.Shell.Interop.8.0.dll)

Syntax

'Declaration
Function CheckForAndSaveDeferredSaveSolution ( _
    fCloseSolution As Integer, _
    pszMessage As String, _
    pszTitle As String, _
    grfFlags As UInteger _
) As Integer
'Usage
Dim instance As IVsSolution3 
Dim fCloseSolution As Integer 
Dim pszMessage As String 
Dim pszTitle As String 
Dim grfFlags As UInteger 
Dim returnValue As Integer 

returnValue = instance.CheckForAndSaveDeferredSaveSolution(fCloseSolution, _
    pszMessage, pszTitle, grfFlags)
int CheckForAndSaveDeferredSaveSolution(
    int fCloseSolution,
    string pszMessage,
    string pszTitle,
    uint grfFlags
)
int CheckForAndSaveDeferredSaveSolution(
    [InAttribute] int fCloseSolution, 
    [InAttribute] String^ pszMessage, 
    [InAttribute] String^ pszTitle, 
    [InAttribute] unsigned int grfFlags
)
function CheckForAndSaveDeferredSaveSolution(
    fCloseSolution : int, 
    pszMessage : String, 
    pszTitle : String, 
    grfFlags : uint
) : int

Parameters

  • fCloseSolution
    Type: System.Int32

    [in] Boolean value; specifies whether to close the solution after it is saved.

  • pszMessage
    Type: System.String

    [in] A string specifying the text displayed when the user is prompted to save or discard changes.

  • pszTitle
    Type: System.String

    [in] A string specifying the title of the dialog box prompting the user to save or discard changes.

Return Value

Type: System.Int32
If the method succeeds, it returns S_OK. If it fails, it returns an error code.

Remarks

This method checks if the solution is in the deferred-save state, and if it is, it will prompt with a MessageBox-like dialog for confirmation then a Save dialog will appear. If fCloseSolution is set to TRUE, the solution will be closed after it is saved and the user will be given the option of discarding changes. If fCloseSolution is set to FALSE, the solution will not be closed after it is saved.

The title and message of the prompt dialog are set similarly as for a MessageBox. The buttons on the prompt dialog are Save, Discard and Cancel. If fCloseSolution is FALSE, Discard will not appear. The default button is always Save.

COM Signature

From vsshell80.idl:

HRESULT IVsSolution3::CheckForAndSaveDeferredSaveSolution(
   [in] BOOL fCloseSolution, 
   [in] LPCOLESTR pszMessage, 
   [in] LPCOLESTR pszTitle, 
   [in] VSSAVEDEFERREDSAVEFLAGS grfFlags
);

.NET Framework Security

See Also

Reference

IVsSolution3 Interface

IVsSolution3 Members

Microsoft.VisualStudio.Shell.Interop Namespace