Memento.Mementor.ExecuteNoTrack C# (CSharp) Method

ExecuteNoTrack() public method

Executes the supplied code block with IsTrackingEnabled turned off.
public ExecuteNoTrack ( System.Action codeBlock ) : void
codeBlock System.Action The code block to be executed.
return void
        public void ExecuteNoTrack(Action codeBlock)
        {
            var previousState = IsTrackingEnabled;
            IsTrackingEnabled = false;
            try {
                codeBlock();
            }
            finally {
                IsTrackingEnabled = previousState;
            }
        }