예제 #1
0
        ///  <summary>
        ///  Requests to stop receiving notification messages when a device in an
        ///  interface class is attached or removed.
        ///  </summary>
        ///
        ///  <param name="deviceNotificationHandle"> handle returned previously by
        ///  RegisterDeviceNotification. </param>

        internal void StopReceivingDeviceNotifications(IntPtr deviceNotificationHandle)
        {
            try
            {
                // ***
                //  API function

                //  summary
                //  Stop receiving notification messages.

                //  parameters
                //  Handle returned previously by RegisterDeviceNotification.

                //  returns
                //  True on success.
                // ***

                //  Ignore failures.

                DeviceManagement.UnregisterDeviceNotification(deviceNotificationHandle);
            }
            catch (Exception ex)
            {
                throw;
            }
        }
예제 #2
0
        ///  <summary>
        ///  Requests to stop receiving notification messages when a device in an
        ///  interface class is attached or removed.
        ///  </summary>
        ///
        ///  <param name="deviceNotificationHandle"> handle returned previously by
        ///  RegisterDeviceNotification. </param>

        internal void StopReceivingDeviceNotifications(IntPtr deviceNotificationHandle)
        {
            try
            {
                //  Ignore failures.
                DeviceManagement.UnregisterDeviceNotification(deviceNotificationHandle);
            }
#pragma warning disable 0168
            catch (Exception ex)
#pragma warning restore 0168
            {
                throw;
            }
        }