internal WindowsDeviceNotifyEventArgs(DevBroadcastHdr hdr, IntPtr ptrHdr, EventType eventType)
        {
            mBaseHdr    = hdr;
            mEventType  = eventType;
            mDeviceType = mBaseHdr.DeviceType;
            switch (mDeviceType)
            {
            case DeviceType.Volume:
                mVolume = new VolumeNotifyInfo(ptrHdr);
                mObject = mVolume;
                break;

            case DeviceType.Port:
                mPort   = new PortNotifyInfo(ptrHdr);
                mObject = mPort;
                break;

            case DeviceType.DeviceInterface:
                mDevice = new UsbDeviceNotifyInfo(ptrHdr);
                mObject = mDevice;
                break;
            }
        }
예제 #2
0
        internal DeviceNotifyEventArgs(DEV_BROADCAST_HDR hdr, IntPtr ptrHdr, EventType eventType)
        {
            mBaseHdr   = hdr;
            mEventType = eventType;

            switch (mBaseHdr.dbch_DeviceType)
            {
            case DeviceType.VOLUME:
                mVolume = new VolumeNotifyInfo(ptrHdr);
                mObject = mVolume;
                break;

            case DeviceType.PORT:
                mPort   = new PortNotifyInfo(ptrHdr);
                mObject = mPort;
                break;

            case DeviceType.DEVICEINTERFACE:
                mDevice = new UsbDeviceNotifyInfo(ptrHdr);
                mObject = mDevice;
                break;
            }
        }