Example #1
0
            // Merges another unit into this unit.
            internal void MergeCompositionUnit(CompositionParentUndoUnit unit)
            {
                object[] units = unit.CopyUnits();

                Invariant.Assert(this.Locked); // If this fails, then the Locked = true below is invalid.
                this.Locked = false;

                for (int i = units.Length - 1; i >= 0; i--)
                {
                    Add((IUndoUnit)units[i]);
                }

                this.Locked = true;

                MergeRedoSelectionState(unit);

                _isLastCompositionUnit |= unit.IsLastCompositionUnit;
            }