private async void monitorStream(StreamReader streamReader, StandardStreamType type)
        {
            try {
                char[] buffer = new char[1024];

                using (streamReader)
                    while (!streamReader.EndOfStream)
                    {
                        int read = await streamReader.ReadAsync(buffer, 0, 1024);

                        if (read > 0)
                        {
                            OnStandardDataReceived(streamReader, new StandardDataReceivedEventArgs(type, new string(buffer, 0, read)));
                        }
                    }
            }
            catch (ObjectDisposedException) { } // in case the stream gets closed elsewhere
            catch (NullReferenceException) { }

            StandardInputEnabled = false;

            Debug.WriteLine("end standard " + type + " stream monitor");
        }
 public StandardDataReceivedEventArgs(StandardStreamType type, string data)
 {
     Type = type;
     Data = data;
 }
        private async void monitorStream(StreamReader streamReader, StandardStreamType type) {
            try {
                char[] buffer = new char[1024];

                using (streamReader)
                    while (!streamReader.EndOfStream) {
                        int read = await streamReader.ReadAsync(buffer, 0, 1024);
                        if (read > 0)
                            OnStandardDataReceived(streamReader, new StandardDataReceivedEventArgs(type, new string(buffer, 0, read)));
                    }
            }
            catch (ObjectDisposedException) { } // in case the stream gets closed elsewhere
            catch (NullReferenceException) { }

            StandardInputEnabled = false;

            Debug.WriteLine("end standard " + type + " stream monitor");
        }
Exemplo n.º 4
0
 public StandardDataReceivedEventArgs(StandardStreamType type, string data)
 {
     Type = type;
     Data = data;
 }