private void ApplicationWorkbookBeforeClose(Workbook wb, ref bool cancel) { if (!cancel) { PendingRequest = new CloseRequestInfo(wb, Application.Workbooks.Count); } }
private void ApplicationWorkbookBeforeClose(Workbook wb, ref bool cancel) { if (!cancel) { PendingRequest = new CloseRequestInfo(wb, Application.Workbooks.Count); } }
private void ApplicationWorkbookDeactivate(Workbook wb) { if (Application.Workbooks.Count != 1) return; // With only one workbook available deactivating means it will be closed PendingRequest = null; OnWorkbookClosed(new WorkbookClosedEventArgs(wb)); }
private void ApplicationWorkbookDeactivate(Workbook wb) { if (Application.Workbooks.Count != 1) { return; } // With only one workbook available deactivating means it will be closed PendingRequest = null; OnWorkbookClosed(new WorkbookClosedEventArgs(wb)); }
private void ApplicationWorkbookActivate(Workbook wb) { // A workbook was closed if a request is pending and the workbook count decreased var wasWorkbookClosed = PendingRequest != null && Application.Workbooks.Count < PendingRequest.WorkbookCount; if (wasWorkbookClosed) { var args = new WorkbookClosedEventArgs(PendingRequest.Workbook); PendingRequest = null; OnWorkbookClosed(args); } else { PendingRequest = null; } }
private void ApplicationWorkbookActivate(Workbook wb) { // A workbook was closed if a request is pending and the workbook count decreased var wasWorkbookClosed = PendingRequest != null && Application.Workbooks.Count < PendingRequest.WorkbookCount; if (wasWorkbookClosed) { var args = new WorkbookClosedEventArgs(PendingRequest.Workbook); PendingRequest = null; OnWorkbookClosed(args); } else { PendingRequest = null; } }