private void deviceTwinCallback(int update_state, IntPtr payload, int size, UIntPtr userContextCallback) { string strPayload = Marshal.PtrToStringAnsi(payload, size); DeviceTwinCallbackArgs deviceTwinCallbackArgs = new DeviceTwinCallbackArgs(update_state, strPayload, userContextCallback); OnDeviceTwinCallback(deviceTwinCallbackArgs); }
protected virtual void OnDeviceTwinCallback(DeviceTwinCallbackArgs e) { EventHandler <DeviceTwinCallbackArgs> handler = DeviceTwinCallback; if (handler != null) { handler(this, e); } }