private void onDataReceivedEvent(object sender, DataEventArgs d) { BTDataReceivedEventHandler dataReceived = this.onDataReceived; if (dataReceived == null) return; dataReceived(this, d); }
private void theThread() { System.Diagnostics.Debug.WriteLine("theThread: started..."); try { string s = ""; char[] buf = new char[1]; int iCount = 0; DataEventArgs args = new DataEventArgs(); while (!_bStopThread && _sr!=null) { iCount = _sr.Read(buf, 0, 1); if (iCount != 0) { s = buf.ToString(); args._string = s; onDataReceivedEvent(this, args); } Thread.Sleep(1000); } } catch (ThreadAbortException tax) { System.Diagnostics.Debug.WriteLine("theThread: ThreadAbortException=" + tax.Message); _bStopThread = true; } catch (Exception ex) { System.Diagnostics.Debug.WriteLine("theThread: Exception=" + ex.Message); } System.Diagnostics.Debug.WriteLine("theThread: ...ended"); }
private void OnDataReceived(object sender, DataEventArgs da){ }
void _thread_BTDataReceived(object sender, DataEventArgs d) { throw new NotImplementedException(); }