共用方式為


DocData.OnDocumentClosing Method

Alerts listeners that the document will be closed.

Namespace:  Microsoft.VisualStudio.Modeling.Shell
Assembly:  Microsoft.VisualStudio.Modeling.Sdk.Shell.10.0 (in Microsoft.VisualStudio.Modeling.Sdk.Shell.10.0.dll)

Syntax

'宣告
Protected Overridable Sub OnDocumentClosing ( _
    e As EventArgs _
)
protected virtual void OnDocumentClosing(
    EventArgs e
)
protected:
virtual void OnDocumentClosing(
    EventArgs^ e
)
abstract OnDocumentClosing : 
        e:EventArgs -> unit 
override OnDocumentClosing : 
        e:EventArgs -> unit 
protected function OnDocumentClosing(
    e : EventArgs
)

Parameters

Remarks

Raising an event invokes the event handler through a delegate. For more information, see Raising an Event.

The OnDocumentClosing method also allows derived classes to handle the event without attaching a delegate. This technique is recommended for handling the event in a derived class.

Notes to Inheritors

When you override OnDocumentClosing in a derived class, be sure to call the base class’s OnDocumentClosing method so that registered delegates receive the event.

.NET Framework Security

See Also

Reference

DocData Class

Microsoft.VisualStudio.Modeling.Shell Namespace