Пример #1
0
        /// <summary>
        /// Creates a snapshot of the current transaction stack from which subsequent changes on the transaction stack will affect
        /// the dirty flag of <seealso cref="IDirtiable"/> objects.
        /// </summary>
        /// <param name="clearFrozenOperations">Indicates if the frozen operations discarded because the stack was full should be cleared.</param>
        /// <remarks>This method also updates the dirty flag of dirtiable objects immediately.</remarks>
        /// <returns>The snapshot that has been created.</returns>
        public DirtiableSnapshot CreateSnapshot(bool clearFrozenOperations = true)
        {
            var dirtiables = new HashSet<IDirtiable>(dirtyingOperationsMap.Keys);
            if (clearFrozenOperations)
            {
                frozenOperationsMap.Clear();
            }

            snapshot = new DirtiableSnapshot(allOperations);
            UpdateDirtiables(dirtiables);
            return snapshot;
        }
Пример #2
0
        /// <summary>
        /// Creates a snapshot of the current transaction stack from which subsequent changes on the transaction stack will affect
        /// the dirty flag of <seealso cref="IDirtiable"/> objects.
        /// </summary>
        /// <param name="clearFrozenOperations">Indicates if the frozen operations discarded because the stack was full should be cleared.</param>
        /// <remarks>This method also updates the dirty flag of dirtiable objects immediately.</remarks>
        /// <returns>The snapshot that has been created.</returns>
        public DirtiableSnapshot CreateSnapshot(bool clearFrozenOperations = true)
        {
            var dirtiables = new HashSet <IDirtiable>(dirtyingOperationsMap.Keys);

            if (clearFrozenOperations)
            {
                frozenOperationsMap.Clear();
            }

            snapshot = new DirtiableSnapshot(allOperations);
            UpdateDirtiables(dirtiables);
            return(snapshot);
        }