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; } ); }
private static void Wfo_DataWritten(object sender, DataWrittenEventArgs e) { waveFileBytesWritten = e.TotalDataWritten; waveDataOverflowWarningCount = e.DataOverflowWarningCount; }
private static void Vtsfo_DataWritten(object sender, DataWrittenEventArgs e) { vtsFileBytesWritten = e.TotalDataWritten; vtsDataOverflowWarningCount = e.DataOverflowWarningCount; }
protected virtual void OnDataWritten(object sender, DataWrittenEventArgs e) { DataWritten?.Invoke(sender, e); }