private void ApplicationWorkbookBeforeClose(Workbook wb, ref bool cancel)
 {
     if (!cancel)
     {
         PendingRequest = new CloseRequestInfo(wb, Application.Workbooks.Count);
     }
 }
Пример #2
0
 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));
        }
Пример #4
0
        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));
        }
Пример #5
0
        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;
            }
        }
Пример #6
0
        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;
            }
        }