internal StreamingTextWriter(WriteLineCallback writeCall, CultureInfo culture) : base(culture) { if (writeCall == null) { throw PSTraceSource.NewArgumentNullException("writeCall"); } this.writeCall = writeCall; }
/// <summary> /// Create an instance by passing a delegate. /// </summary> /// <param name="writeCall">Delegate to write to.</param> /// <param name="culture">Culture for this TextWriter.</param> internal StreamingTextWriter(WriteLineCallback writeCall, CultureInfo culture) : base(culture) { if (writeCall is null) { throw PSTraceSource.NewArgumentNullException(nameof(writeCall)); } _writeCall = writeCall; }
private void WriteLine(string text) { if (textBox1.InvokeRequired) { WriteLineCallback d = new WriteLineCallback(WriteLine); this.Invoke(d, new object[] { text }); } else { textBox1.Text = String.Join("\r\n", text, textBox1.Text); } }
public void WriteLine(String line) { // InvokeRequired required compares the thread ID of the // calling thread to the thread ID of the creating thread. // If these threads are different, it returns true. if (Output.InvokeRequired) { WriteLineCallback d = new WriteLineCallback(WriteLine); this.Invoke(d, new object[] { line }); } else { Output.AppendText(line + "\n"); } }
private void WriteLine(string line) { var sb = new StringBuilder(); sb.Append("["); sb.Append(DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss")); sb.Append("] "); sb.AppendLine(line); if (eventLog.InvokeRequired) { var d = new WriteLineCallback(WriteLine); Invoke(d, new[] { line }); } else { eventLog.Text += sb.ToString(); eventLog.SelectionStart = eventLog.Text.Length; eventLog.ScrollToCaret(); } }
public StreamingManager(IObservable<StreamingMessage> _observable, MessageType _messageType, double _throttleTime, WriteLineCallback _writeLine) { observable = _observable; messageType = _messageType; throttleTime = _throttleTime; writeLine = _writeLine; timer.Elapsed += new System.Timers.ElapsedEventHandler(TimerElapsed); }
public void WriteLine(string text) { if (this.Output.InvokeRequired) { WriteLineCallback d = new WriteLineCallback(WriteOutput); this.Invoke(d, new object[] { text }); } else { WriteOutput(text + "\r\n"); } }