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