A text writer that can remember indents across new lines
Inheritance: System.IO.TextWriter
 public ObjectInfosPrinter(IndentableTextWriter output, Action<ObjectInfo> write)
 {
     if (output == null) throw new ArgumentNullException("output");
     if (write == null) throw new ArgumentNullException("write");
     _output = output;
     _write = write;
 }
        public void PrintTo(TextWriter output)
        {
            var ex = _rootObject as Exception;
            var useCache = _config.EnableExceptionCaching && ex != null;
            if (useCache && ex.Data.Contains(CacheKey))
            {
                output.Write((string)ex.Data[CacheKey]);
                return;
            }

            _output = new IndentableTextWriter(output, _tab, _newline);
            _objectInfosPrinter = new ObjectInfosPrinter(_output, AppendValue);
            WriteObject(new ObjectInfo(_rootObject));
        }
        public void should_alter_tab_depth_with_indent_and_outdent()
        {
            var sb = new StringBuilder();
            var writer = new IndentableTextWriter(new StringWriter(sb), "\t", "\n");

            writer.Write("a small");
            writer.WriteLine(" test");
            writer.Indent();
            writer.WriteLine("determines\n");
            writer.Outdent();
            writer.Write("if\r");
            writer.Indent();
            writer.WriteLine("this");
            writer.WriteLine("\twill");
            writer.Indent();
            writer.WriteLine("work");

            sb.ToString().Should().Be("a small test\n\tdetermines\n\nif\n\tthis\n\t\twill\n\t\twork\n");
            Console.Out.WriteLine(sb.ToString());
        }