void ISensorEvents.OnDataUpdated(ISensor sensor, ISensorDataReport newData) { DataReport = SensorReport.FromNativeReport(this, newData); if (DataReportChanged != null) { DataReportChanged.Invoke(this, EventArgs.Empty); } }
internal HResult InternalUpdateData() { ISensorDataReport iReport; HResult hr = nativeISensor.GetData(out iReport); if (hr == HResult.Ok) { try { DataReport = SensorReport.FromNativeReport(this, iReport); if (DataReportChanged != null) { DataReportChanged.Invoke(this, EventArgs.Empty); } } finally { Marshal.ReleaseComObject(iReport); } } return(hr); }