private void ApplicationWorkbookBeforeClose(Workbook wb, ref bool cancel)
 {
     if (!cancel)
     {
         PendingRequest = new CloseRequestInfo(wb, Application.Workbooks.Count);
     }
 }
Esempio n. 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));
        }
Esempio n. 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));
        }
        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;
            }
        }
Esempio n. 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;
            }
        }