public void Write(byte[] data, WriteCallback callback) { WriteDelegate writeDelegate = Write; HidAsyncState @object = new HidAsyncState(writeDelegate, callback); writeDelegate.BeginInvoke(data, EndWrite, @object); }
public void WriteReport(HidReport report, WriteCallback callback) { WriteReportDelegate writeReportDelegate = WriteReport; HidAsyncState @object = new HidAsyncState(writeReportDelegate, callback); writeReportDelegate.BeginInvoke(report, EndWriteReport, @object); }
public void ReadReport(ReadReportCallback callback) { ReadReportDelegate readReportDelegate = ReadReport; HidAsyncState @object = new HidAsyncState(readReportDelegate, callback); readReportDelegate.BeginInvoke(EndReadReport, @object); }
public void ReadReport(ReadReportCallback callback) { var readReportDelegate = new ReadReportDelegate(ReadReport); var asyncState = new HidAsyncState(readReportDelegate, callback); readReportDelegate.BeginInvoke(EndReadReport, asyncState); }
public void FastReadReport(ReadReportCallback callback, int timeout) { var readReportDelegate = new ReadReportDelegate(FastReadReport); var asyncState = new HidAsyncState(readReportDelegate, callback); readReportDelegate.BeginInvoke(timeout, EndReadReport, asyncState); }
public void Write(byte[] data, WriteCallback callback, int timeout) { var writeDelegate = new WriteDelegate(Write); var asyncState = new HidAsyncState(writeDelegate, callback); writeDelegate.BeginInvoke(data, timeout, EndWrite, asyncState); }
public void WriteReport(HidReport report, WriteCallback callback, int timeout) { var writeReportDelegate = new WriteReportDelegate(WriteReport); var asyncState = new HidAsyncState(writeReportDelegate, callback); writeReportDelegate.BeginInvoke(report, timeout, EndWriteReport, asyncState); }
public void Read(ReadCallback callback) { ReadDelegate readDelegate = Read; HidAsyncState @object = new HidAsyncState(readDelegate, callback); readDelegate.BeginInvoke(EndRead, @object); }
public void Read(ReadCallback callback, int timeout) { var readDelegate = new ReadDelegate(Read); var asyncState = new HidAsyncState(readDelegate, callback); readDelegate.BeginInvoke(timeout, EndRead, asyncState); }
private static void EndWriteReport(IAsyncResult ar) { HidAsyncState hidAsyncState = (HidAsyncState)ar.AsyncState; WriteReportDelegate writeReportDelegate = (WriteReportDelegate)hidAsyncState.CallerDelegate; WriteCallback writeCallback = (WriteCallback)hidAsyncState.CallbackDelegate; bool success = writeReportDelegate.EndInvoke(ar); writeCallback?.Invoke(success); }
protected static void EndReadReport(IAsyncResult ar) { HidAsyncState hidAsyncState = (HidAsyncState)ar.AsyncState; ReadReportDelegate readReportDelegate = (ReadReportDelegate)hidAsyncState.CallerDelegate; ReadReportCallback readReportCallback = (ReadReportCallback)hidAsyncState.CallbackDelegate; HidReport report = readReportDelegate.EndInvoke(ar); readReportCallback?.Invoke(report); }
protected static void EndRead(IAsyncResult ar) { HidAsyncState hidAsyncState = (HidAsyncState)ar.AsyncState; ReadDelegate readDelegate = (ReadDelegate)hidAsyncState.CallerDelegate; ReadCallback readCallback = (ReadCallback)hidAsyncState.CallbackDelegate; HidDeviceData data = readDelegate.EndInvoke(ar); readCallback?.Invoke(data); }
public void WriteReport(HidReport report, WriteCallback callback) { var writeReportDelegate = new WriteReportDelegate(WriteReport); var asyncState = new HidAsyncState(writeReportDelegate, callback); writeReportDelegate.BeginInvoke(report, EndWriteReport, asyncState); }
public void Write(byte[] data, WriteCallback callback) { var writeDelegate = new WriteDelegate(Write); var asyncState = new HidAsyncState(writeDelegate, callback); writeDelegate.BeginInvoke(data, EndWrite, asyncState); }
public void Read(ReadCallback callback) { var readDelegate = new ReadDelegate(Read); var asyncState = new HidAsyncState(readDelegate, callback); readDelegate.BeginInvoke(EndRead, asyncState); }