public override bool Close() { bool result; if (result = this.backend.NotNull() && this.backend.Close()) this.backend = null; return result; }
public PatternWriter(bool useColours) { var writer = new AsciiWriter(); _characterWriter = useColours ? (ICharacterWriter) new ColorWriter(writer) : writer; }
public bool Send(ICharacterWriter writer) { return writer.WriteLine(this.Protocol + " " + this.Status) && (headers.IsNull() || this.headers.All(header => writer.WriteLine(header.Key + ": " + header.Value))) && writer.WriteLine() && writer.Flush(); }
public Indenter(ICharacterWriter backend) { this.backend = backend; this.Format = true; }
public ColorWriter(ICharacterWriter innerWriter) { _innerWriter = innerWriter; }