// Implement the IRedirectOutput interface. public virtual void SetOutputStream(IMessageReceiver output) { // Wrap up the receiver to turn it into a stream. COMCharStream stream = new COMCharStream(output); StreamWriter writer = new StreamWriter (stream, Encoding.Default); // Do a flush after every write operation. writer.AutoFlush = true; // Set the stdout and stderr streams for the script. lock(typeof(VsaEngine)) { if(Globals.contextEngine != this) { // This instance has been detached, so set its // local output streams. engineInstance.SetOutputStreams(writer, writer); } else { #if !CONFIG_SMALL_CONSOLE // Use the global "ScriptStream" class for the // default engine instance. ScriptStream.Out = writer; ScriptStream.Error = writer; #endif } } }
public virtual void SetOutputStream(IMessageReceiver output){ COMCharStream stream = new COMCharStream(output); System.IO.StreamWriter writer = new System.IO.StreamWriter(stream, Encoding.Default); writer.AutoFlush = true; ScriptStream.Out = writer; ScriptStream.Error = writer; }
public void SetOutputStream(IMessageReceiver output) { COMCharStream stream = new COMCharStream(output); StreamWriter writer = new StreamWriter(stream, Encoding.Default) { AutoFlush = true }; ScriptStream.Out = writer; ScriptStream.Error = writer; }