This delegate defines the signature that an event handler must use
in order to receive the
SystemEvents.SessionEnding event. This event
is raised when the user has chosen to log off or shutdown the system. It occurs
SessionEndingEventArgs provides a
property, which you can set in the event handler to cancel the pending shutdown.
public delegate void SessionEndingEventHandler( object sender, SessionEndingEventArgs e);