/// <summary>Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.</summary> /// <exception cref="InvalidOperationException">Thrown when the requested operation is invalid.</exception> public void Dispose() { if (this.owner != null) { try { if (this.owner.indent != this) { throw new InvalidOperationException("The indenting does not match"); } this.owner.indent = this.previous; } finally { this.owner = null; } } }
/// <summary>Constructor.</summary> /// <param name="owner">The owner.</param> /// <param name="depth">The depth.</param> public IndentInfo(RichTextWriter owner, int depth) { this.owner = owner; this.depth = depth; this.previous = owner.indent; }