Esempio n. 1
0
        private static void UnregisterDeviceStateChangedEvent()
        {
            Native.RemoveDeviceStateChangedCallback(_deviceStateChangedId).
            ThrowIfError("Failed to remove the event handler.");

            _deviceStateChangedCallback = null;
        }
Esempio n. 2
0
        private static void RegisterDeviceStateChangedEvent()
        {
            _deviceStateChangedCallback = (type, state, _) =>
            {
                _deviceStateChanged?.Invoke(null, new RecorderDeviceStateChangedEventArgs(type, state));
            };

            Native.AddDeviceStateChangedCallback(_deviceStateChangedCallback, IntPtr.Zero, out _deviceStateChangedId).
            ThrowIfError("Failed to add the event handler.");
        }