Esempio n. 1
0
        void TransactionOpened(object sender, EventArgs e)
        {
            IsSelectComponents = true;
            if (!report.TransactionScription.StartsWith("创建") && report.TransactionScription != "一方报表" && report.GetSelectedComponents().Count == 0)
            {
                IsSelectComponents = false;
                return;
            }

            if (transactionLevel == 0)
            {
                undoOperations             = 0;
                selectComponentsUndoAction = new SelectComponentsUndoAction(report, GetSelectedComponentNames(report));
                undoStack.Push(selectComponentsUndoAction);
            }
            ++transactionLevel;
        }
Esempio n. 2
0
        void TransactionClosed(object sender, DesignerTransactionCloseEventArgs e)
        {
            if (!IsSelectComponents)
            {
                return;
            }

            --transactionLevel;
            if (transactionLevel == 0 && undoOperations > 0)
            {
                if (selectComponentsUndoAction != null)
                {
                    selectComponentsUndoAction.SetNewSelection(GetSelectedComponentNames(report));
                    selectComponentsUndoAction = null;
                }
                undoStack.UndoLast(undoOperations + 1);
            }
        }