IVsSolution3.CheckForAndSaveDeferredSaveSolution Method (Int32, String, String, UInt32)
Checks if the solution is in the deferred-save state.
Assembly: Microsoft.VisualStudio.Shell.Interop.8.0 (in Microsoft.VisualStudio.Shell.Interop.8.0.dll)
int CheckForAndSaveDeferredSaveSolution( int fCloseSolution, string pszMessage, string pszTitle, uint grfFlags )
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.
- grfFlags
-
Type:
System.UInt32
[in] A __VSSAVEDEFERREDSAVEFLAGS value specifying save options.
Return Value
Type: System.Int32If the method succeeds, it returns S_OK. If it fails, it returns an error code.
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.
From vsshell80.idl:
HRESULT IVsSolution3::CheckForAndSaveDeferredSaveSolution( [in] BOOL fCloseSolution, [in] LPCOLESTR pszMessage, [in] LPCOLESTR pszTitle, [in] VSSAVEDEFERREDSAVEFLAGS grfFlags );