From d7614f5718bbee687f7067c9596ed19f43124fc9 Mon Sep 17 00:00:00 2001 From: thefiddler Date: Thu, 13 Mar 2014 18:44:36 +0100 Subject: [PATCH] [Bind] Clean up BindStreamWriter implementation Instead of inheriting and overriding StreamWriter methods, it now forwards its parameters to an internal StreamWriter, after applying the necessary formatting changes. This shields us from the StreamWriter implementation differences between .Net and Mono. --- Source/Bind/BindStreamWriter.cs | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/Source/Bind/BindStreamWriter.cs b/Source/Bind/BindStreamWriter.cs index f627ef07..75a3f2a8 100644 --- a/Source/Bind/BindStreamWriter.cs +++ b/Source/Bind/BindStreamWriter.cs @@ -98,17 +98,8 @@ namespace Bind public void WriteLine(string value) { - // The Mono implementation of WriteLine calls Write internally. - // The .Net implementation does not. - // If running on Mono, we must avoid indenting in WriteLine - // because then we'll indent twice (once in WriteLine and once in Write). - // If running on .Net we must indent in both WriteLine and Write. - // Neat, no? - if (System.Type.GetType("Mono.Runtime") == null) - { - WriteIndentations(); - } - sw.WriteLine(value); + Write(value); + WriteLine(); } public void WriteLine(string format, params object[] args)