예제 #1
0
 internal StreamingTextWriter(WriteLineCallback writeCall, CultureInfo culture) : base(culture)
 {
     if (writeCall == null)
     {
         throw PSTraceSource.NewArgumentNullException("writeCall");
     }
     this.writeCall = writeCall;
 }
예제 #2
0
 internal StreamingTextWriter(WriteLineCallback writeCall, CultureInfo culture) : base(culture)
 {
     if (writeCall == null)
     {
         throw PSTraceSource.NewArgumentNullException("writeCall");
     }
     this.writeCall = writeCall;
 }
예제 #3
0
        /// <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;
        }
예제 #4
0
 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);
     }
 }
예제 #5
0
 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");
       }
 }
예제 #6
0
 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");
     }
 }
예제 #7
0
파일: IrcPanel.cs 프로젝트: Tawling/botwoon
        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();
            }
        }
예제 #8
0
 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);
 }
예제 #9
0
 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");
     }
 }