From 664d7c244579846023d4800ea1c36fe96b24ef43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20H=C3=B6glinger-Stelzer?= Date: Sat, 24 Nov 2018 17:11:31 +0100 Subject: [PATCH] Removed unused method Typo fixes Applied refactoring --- .gitignore | 5 +++-- PInvokeSerialPort/SerialPort.cs | 19 +++++-------------- 2 files changed, 8 insertions(+), 16 deletions(-) diff --git a/.gitignore b/.gitignore index 21072ad..73d2554 100755 --- a/.gitignore +++ b/.gitignore @@ -28,5 +28,6 @@ obj/ _ReSharper*/ [Tt]est[Rr]esult* *.testsettings -PInvokeSerialPort.nupkg -/.vs/PInvokeSerialPort/v15/Server/sqlite3 +*.nupkg +/.vs +/packages diff --git a/PInvokeSerialPort/SerialPort.cs b/PInvokeSerialPort/SerialPort.cs index 7f5de2c..5ed0719 100755 --- a/PInvokeSerialPort/SerialPort.cs +++ b/PInvokeSerialPort/SerialPort.cs @@ -144,7 +144,7 @@ namespace PInvokeSerialPort public ASCII XonChar = ASCII.DC1; /// - /// Class contructor + /// Class constructor /// public SerialPort(string portName) { @@ -152,7 +152,7 @@ namespace PInvokeSerialPort } /// - /// Class contructor + /// Class constructor /// public SerialPort(string portName, int baudRate) { @@ -316,6 +316,7 @@ namespace PInvokeSerialPort } } + /// /// /// For IDisposable /// @@ -554,15 +555,6 @@ namespace PInvokeSerialPort if (!Win32Com.TransmitCommChar(_hPort, tosend)) ThrowException("Transmission failure"); } - /// - /// Delay processing. - /// - /// Milliseconds to delay by - protected void Sleep(int milliseconds) - { - Thread.Sleep(milliseconds); - } - /// /// Gets the status of the modem control input signals. /// @@ -619,8 +611,7 @@ namespace PInvokeSerialPort /// The byte that was received protected void OnRxChar(byte ch) { - if (DataReceived != null) - DataReceived(ch); + DataReceived?.Invoke(ch); } /// @@ -639,7 +630,7 @@ namespace PInvokeSerialPort } /// - /// Override this to take action when a ring condition is signalled by an attached modem. + /// Override this to take action when a ring condition is signaled by an attached modem. /// protected virtual void OnRing() {