When implemented in a derived class, executes when the system is shutting down. Specifies what should happen immediately prior to the system shutting down.
[Visual Basic] Protected Overridable Sub OnShutdown() [C#] protected virtual void OnShutdown(); [C++] protected: virtual void OnShutdown(); [JScript] protected function OnShutdown();
Use OnShutdown to specify the processing that occurs when the system shuts down. Often, OnShutdown will be similar to the processing in OnStop. This event occurs only when the operating system is shut down, not when the computer is turned off.
OnShutdown is expected to be overridden when the CanShutdown property is true.
Platforms: Windows NT Server 4.0, Windows NT Workstation 4.0, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family
.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