Beispiel #1
0
            public override ReferenceOperationResultType OnRowsInserted(int insertAt, int count)
            {
                ReferenceOperationResultType startAffected  = _owner._start.GridOps.OnRowsInserted(insertAt, count);
                ReferenceOperationResultType finishAffected = _owner._finish.GridOps.OnRowsInserted(insertAt, count);

                return(startAffected | finishAffected);
            }
Beispiel #2
0
        /// <summary>
        ///     Perform an operation on a set of references
        /// </summary>
        public void DoReferenceOperation(IList targets, ReferenceOperator refOp)
        {
            // Keep track of references in various states
            IList affectedValid = new ArrayList();
            IList invalid       = new ArrayList();
            IList affected      = new ArrayList();

            refOp.PreOperate(targets);

            foreach (Reference @ref in targets)
            {
                ReferenceOperationResultType result = refOp.Operate(@ref);

                if (result != ReferenceOperationResultType.NotAffected)
                {
                    // Note references that are affected (valid or not)
                    affected.Add(@ref);
                }

                if (result == ReferenceOperationResultType.Invalidated)
                {
                    // Note invalid references
                    invalid.Add(@ref);
                }
                else if (result == ReferenceOperationResultType.Affected)
                {
                    // Note affected but valid references
                    affectedValid.Add(@ref);
                }
            }

            ProcessInvalidReferences(invalid);
            ProcessAffectedValidReferences(affectedValid);
            _owner.RemoveInvalidFormulas(invalid);
            _owner.RecalculateAffectedReferences(affected);
            refOp.PostOperate(affectedValid);
        }