Skip to content
Browse files

Removed a useless class

  • Loading branch information...
1 parent 9f08522 commit aa560196ac44ab1d6307b38de6fcf7a7aac03ec8 @JordanZaerr committed
Showing with 5 additions and 38 deletions.
  1. +0 −34 UsbUirt Managed Wrapper/DisposableObject.cs
  2. +5 −4 UsbUirt Managed Wrapper/Transmitter.cs
View
34 UsbUirt Managed Wrapper/DisposableObject.cs
@@ -1,34 +0,0 @@
-using System;
-
-namespace UsbUirt
-{
- public abstract class DisposableObject : IDisposable
- {
- private bool _disposed;
-
- protected void CheckDisposed()
- {
- if (_disposed)
- {
- throw new ObjectDisposedException("The object has already been disposed");
- }
- }
-
- public void Dispose()
- {
- Dispose(true);
- GC.SuppressFinalize(this);
- }
-
- private void Dispose(bool isDisposing)
- {
- if (isDisposing)
- {
- _disposed = true;
- InternalDispose();
- }
- }
-
- protected abstract void InternalDispose();
- }
-}
View
9 UsbUirt Managed Wrapper/Transmitter.cs
@@ -148,7 +148,7 @@ public bool BlinkOnTransmit
/// <param name="emitter">The emitter to transmit the IR code with</param>
/// <param name="userState">An optional user state object that will be passed to the
/// TransmitCompleted event.</param>
- public void TransmitAsync(
+ public Task TransmitAsync(
string irCode,
object userState = null,
Emitter? emitter = null,
@@ -157,13 +157,13 @@ public bool BlinkOnTransmit
int? inactivityWaitTime = null)
{
CheckDisposed();
- Task.Factory
+ var task = Task.Factory
.StartNew(() => TransmitInternal(irCode,
codeFormat,
repeatCount,
inactivityWaitTime,
- emitter))
- .ContinueWith(t =>
+ emitter));
+ task.ContinueWith(t =>
{
var temp = TransmitCompleted;
if (null != temp)
@@ -171,6 +171,7 @@ public bool BlinkOnTransmit
temp(this, new TransmitCompletedEventArgs(t.Exception, userState));
}
});
+ return task;
}
[SecuritySafeCritical]

0 comments on commit aa56019

Please sign in to comment.
Something went wrong with that request. Please try again.