次の方法で共有


IVsRunningDocTableEvents.OnAfterSave Method

Called after saving a document in the Running Document Table (RDT).

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

Syntax

'宣言
Function OnAfterSave ( _
    docCookie As UInteger _
) As Integer
'使用
Dim instance As IVsRunningDocTableEvents
Dim docCookie As UInteger
Dim returnValue As Integer

returnValue = instance.OnAfterSave(docCookie)
int OnAfterSave(
    uint docCookie
)
int OnAfterSave(
    [InAttribute] unsigned int docCookie
)
function OnAfterSave(
    docCookie : uint
) : int

Parameters

  • docCookie
    Type: System.UInt32

    [in] Abstract value representing the document that has just been saved.

Return Value

Type: System.Int32

If the method succeeds, it returns S_OK. If it fails, it returns an error code.

Remarks

If you want to know if your project or solution is currently closing after you receive an OnAfterSave notification, you need to monitor events on the IVsSolutionEvents3 interface. Follow these steps:

  1. Query the SVsSolution service to get an IVsSolution interface.

  2. Obtain the IVsSolution2 interface from the IVsSolution interface.

  3. Next, call AdviseSolutionEvents to pass in your implementation of the IVsSolutionEvents3 interface.

COM Signature

From vsshell.idl:

HRESULT IVsRunningDocTableEvents::OnAfterSave(
   [in] VSCOOKIE docCookie
);

Permissions

See Also

Reference

IVsRunningDocTableEvents Interface

IVsRunningDocTableEvents Members

Microsoft.VisualStudio.Shell.Interop Namespace