prevent to display things double in console

This commit is contained in:
Philip Schell 2019-11-29 14:45:42 +01:00
parent 4296649dca
commit 69f5534523
2 changed files with 12 additions and 14 deletions

View File

@ -65,13 +65,13 @@ namespace BlubbFish.Utils {
private void DisattachToFw() {
this.stdout.WriteEvent -= this.fw.Write;
this.stdout.WriteLineEvent -= this.fw.WriteLine;
this.errout.WriteEvent -= this.fw.WriteLine;
this.errout.WriteEvent -= this.fw.Write;
this.errout.WriteLineEvent -= this.fw.WriteLine;
}
private void AttachToFw() {
this.stdout.WriteEvent += this.fw.Write;
this.stdout.WriteLineEvent += this.fw.WriteLine;
this.errout.WriteEvent += this.fw.WriteLine;
this.errout.WriteEvent += this.fw.Write;
this.errout.WriteLineEvent += this.fw.WriteLine;
}
}
@ -137,14 +137,13 @@ namespace BlubbFish.Utils {
}
public override Encoding Encoding => Encoding.UTF8;
public override void Write(String value) {
this.WriteEvent?.Invoke(this, new ConsoleWriterEventArgs(value, this.stream, this.streamtype));
base.Write(value);
}
public override void WriteLine(String value) {
this.WriteLineEvent?.Invoke(this, new ConsoleWriterEventArgs(value, this.stream, this.streamtype));
base.WriteLine(value);
}
public override void Write(String value) => this.WriteEvent?.Invoke(this, new ConsoleWriterEventArgs(value, this.stream, this.streamtype));
//base.Write(value);
public override void WriteLine(String value) => this.WriteLineEvent?.Invoke(this, new ConsoleWriterEventArgs(value, this.stream, this.streamtype));
//base.WriteLine(value);
public event EventHandler<ConsoleWriterEventArgs> WriteEvent;
public event EventHandler<ConsoleWriterEventArgs> WriteLineEvent;
}

View File

@ -1,12 +1,11 @@
using System.Reflection;
#if !NETCOREAPP
using System.Reflection;
using System.Resources;
using System.Runtime.InteropServices;
// Allgemeine Informationen über eine Assembly werden über die folgenden
// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern,
// die mit einer Assembly verknüpft sind.
#if NETCOREAPP
#else
[assembly: AssemblyTitle("Utils")]
[assembly: AssemblyDescription("Provides useful classes for other projects")]
[assembly: AssemblyConfiguration("")]