void GroupScopeClose(GroupScope scope) { scope.OnDisposed -= GroupScopeClose; if (_groupStack.Pop() != scope.Group) { throw new System.Exception("Unexpected group was closed."); } }
protected GroupScope Group(OutputGroup group) { var scope = new GroupScope(group); scope.OnDisposed += GroupScopeClose; _groupStack.Push(scope.Group); return(scope); }