, , , Cancel = false, Cancel = true. , " " .
, OR AND . Reflector, CancelEventArgs.Cancel, :
public bool Cancel
{
get{ return this.cancel; }
set{ this.cancel = value; }
}
, "Form.OnClosing(CancelEventArgs args)" , , , , Reflector:
[EditorBrowsable(EditorBrowsableState.Advanced)]
protected virtual void OnClosing(CancelEventArgs e)
{
CancelEventHandler handler = (CancelEventHandler) base.Events[EVENT_CLOSING];
if (handler != null)
{
handler(this, e);
}
}
, , EVENT_CLOSING Events API , handler OnClosing null, Cancel = true, , CancelEventArgs.Cancel == true. EventHandlerList, :
get {
ListEntry e = null;
if (parent == null || parent.CanRaiseEventsInternal)
{
e = Find(key);
}
if (e != null) {
return e.handler;
}
else {
return null;
}
}
parent.CanRaiseEventsInternal , .
... , , , , , . CancelEventHandler, CancelEventArgs.Cancel , true. , , Cancel = false Cancel = true. - ? - ?
public bool Cancel
{
get{ return this.cancel; }
set{ this.cancel = this.cancel || value; }
}