#pragma warning restore CS0168 // Variable is declared but never used

        private void StreamReaderThread()
        {
            while (true)
            {
                ValidateConnection();
                try
                {
                    var lines = ReadLines();
                    foreach (var line in lines)
                    {
                        System.Diagnostics.Debug.WriteLine(line);
                        LineRead?.Invoke(line);
                    }
                    Thread.Sleep(10);
                }
                // As far as i can tell there isn't a way to handle the socket exception without a try catch.
                // it might just be that valve f****d it up on their end.
                catch (Exception)
                {
                    return;
                }
            }
        }
示例#2
0
 private void OnOutputDataReceived(object sender, DataReceivedEventArgs e)
 {
     LineRead?.Invoke(sender, new LineReadEventArgs(e.Data));
 }
示例#3
0
 private void RaiseReadLine(string logLine)
 {
     LineRead?.Invoke(logLine);
 }
示例#4
0
 public static void LineRed(string s)
 {
     LineRead?.Invoke(s);
 }