I have an ADK provided by a hardware manufacturer for connecting to and using their hardware.
The ADK is a DLL we have referenced in our project, then called and used methods based on events. The problem is that the DLL constantly writes some text to the console. The string is always the same, We need to use the console so completely turning it off is not a viable solution.
I have attempted an implementation of the TextWriter class that ignores this string but this output from the DLL does not come into the class when I breakpoint inside it.
The TextWriter we built looked like this;
public class MyTextWriter : TextWriter
{
private TextWriter _standardOut;
public MyTextWriter(TextWriter ConsoleOut)
{
this._standardOut = ConsoleOut;
}
public override Encoding Encoding
{
get
{
return Encoding.ASCII;
}
}
public override void WriteLine(string val)
{
if(val != "Hello")
{
_standardOut.WriteLine(val);
}
}
}
Is there any other way to stop this DLL writing to the console?