public override bool Remove(Document i) { if (i.CanClose) { var result = new DocumentClosingEventArgs(i); OnClosing(result); return(!result.Cancel ? base.Remove(i) : false); } return(false); }
public override void RemoveAt(int i) { if (this[i].CanClose) { var result = new DocumentClosingEventArgs(this[i]); OnClosing(result); if (!result.Cancel) { base.RemoveAt(i); } } }
void OnClosing(DocumentClosingEventArgs e) => Closing?.Invoke(this, e);