/// <summary> /// Removes the scope from the scope stack. /// </summary> /// <param name="scope">Scope to be removed.</param> private void ExitScope(TransformationScope scope) { lock (this.scopeStack) { ExceptionUtilities.Assert(object.ReferenceEquals(scope, this.scopeStack.Peek()), "Wrong scope given when exiting."); this.scopeStack.Pop(); } }
private IDisposable ApplyScope(TransformationScope scope) { lock (this.scopeStack) { this.scopeStack.Push(scope); return(new DelegateBasedDisposable(() => this.ExitScope(scope))); } }