示例#1
0
        internal void DeviceChanged(IMessageDeviceStatus message)
        {
            if (message == null)
            {
                return;
            }

            if (message.Type == MessageType.DeviceAdded)
            {
                using (IDeviceHandle handle = message.DeviceHandle)
                {
                    if (handle.DeviceType == DeviceType.HMD)
                    {
                        AddDevice((IDeviceHandle <IHMDDevice, IHMDInfo>)handle);
                    }
                }
            }
            else if (message.Type == MessageType.DeviceRemoved)
            {
                using (IDeviceHandle handle = message.DeviceHandle)
                {
                    if (handle.DeviceType == DeviceType.Sensor)
                    {
                        RemoveDevice((IDeviceHandle <ISensorDevice, ISensorInfo>)handle);
                    }
                }
            }
        }
示例#2
0
        internal void DeviceChanged(IMessageDeviceStatus message)
        {
            if (message == null)
                return;

            if (message.Type == MessageType.DeviceAdded)
            {
                using (IDeviceHandle handle = message.DeviceHandle)
                {
                    if (handle.DeviceType == DeviceType.HMD)
                    {
                        AddDevice((IDeviceHandle<IHMDDevice, IHMDInfo>) handle);
                    }
                }
            }
            else if (message.Type == MessageType.DeviceRemoved)
            {
                using (IDeviceHandle handle = message.DeviceHandle)
                {
                    if (handle.DeviceType == DeviceType.Sensor)
                    {
                        RemoveDevice((IDeviceHandle<ISensorDevice, ISensorInfo>) handle);
                    }
                }
            }
        }