mirror of
https://github.com/Ryujinx/Opentk.git
synced 2024-12-24 03:15:30 +00:00
[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.
This commit is contained in:
parent
cf728a631e
commit
d7614f5718
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue