void NewInvoiceExecuted(object sender, EventArgs e) { Debug.Assert(_InvoiceControl == null); _Commands.InvoiceCommands.New.Enabled = false; // Disable new invoice command to prevent re-entrancy _InvoiceControl = new InvoiceControl(); _InvoiceControl.Commands = _Commands; this.ShowModalPanel(_InvoiceControl, DevComponents.DotNetBar.Controls.eSlideSide.Left); if (!_StartControl.Visible) { _StartControl.SlideOutButtonVisible = false; } }
private void CloseInvoiceDialog() { if (!_StartControl.Visible) { _StartControl.SlideOutButtonVisible = true; } _Commands.InvoiceCommands.New.Enabled = true; // Enable new invoice command this.CloseModalPanel(_InvoiceControl, DevComponents.DotNetBar.Controls.eSlideSide.Left); _InvoiceControl.Commands = null; _InvoiceControl.Dispose(); _InvoiceControl = null; }