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
'宣告
Function CheckForAndSaveDeferredSaveSolution ( _
fCloseSolution As Integer, _
pszMessage As String, _
pszTitle As String, _
grfFlags As UInteger _
) As Integer
'用途
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
)
abstract CheckForAndSaveDeferredSaveSolution :
fCloseSolution:int *
pszMessage:string *
pszTitle:string *
grfFlags:uint32 -> int
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.
- grfFlags
Type: System.UInt32
[in] A __VSSAVEDEFERREDSAVEFLAGS value specifying save options.
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
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.