private void OnStreamWrite(object sender, DataWrittenEventArgs e)
        {
            var stream = sender as Stream;

            byte[] writtenBytes = new byte[e.NumBytesWritten];
            stream.Read(writtenBytes, 0, e.NumBytesWritten);
            string value = Encoding.ASCII.GetString(writtenBytes);

            value = value.Replace("\n", Environment.NewLine);

            m_UnderlyingTxt.InvokeIfRequired(() =>
            {
                m_UnderlyingTxt.Text          += value;
                m_NumInputChars                = 0;
                m_UnderlyingTxt.SelectionStart = m_UnderlyingTxt.Text.Length;
            }
                                             );
        }
예제 #2
0
 private static void Wfo_DataWritten(object sender, DataWrittenEventArgs e)
 {
     waveFileBytesWritten         = e.TotalDataWritten;
     waveDataOverflowWarningCount = e.DataOverflowWarningCount;
 }
예제 #3
0
 private static void Vtsfo_DataWritten(object sender, DataWrittenEventArgs e)
 {
     vtsFileBytesWritten         = e.TotalDataWritten;
     vtsDataOverflowWarningCount = e.DataOverflowWarningCount;
 }
예제 #4
0
 protected virtual void OnDataWritten(object sender, DataWrittenEventArgs e)
 {
     DataWritten?.Invoke(sender, e);
 }