Beispiel #1
0
        public void Init(BusManager bmgr, IHostService host, IJoystickDevice device)
        {
            m_bmgr   = bmgr;
            m_host   = host;
            m_device = device;
            var busDevice = (BusDeviceBase)device;

            //txtDevice.Text = busDevice.Name;
            txtDescription.Text = busDevice.Description.Replace("\n", Environment.NewLine);

            cbxType.Items.Clear();
            if (m_host != null && m_host.Joystick != null)
            {
                foreach (var hdi in m_host.Joystick.GetAvailableJoysticks())
                {
                    cbxType.Items.Add(hdi);
                }
            }
            //cbxType.Sorted = true;

            cbxType.SelectedIndex = -1;
            for (var i = 0; i < cbxType.Items.Count; i++)
            {
                var hdi = (IHostDeviceInfo)cbxType.Items[i];
                if (m_device.HostId == hdi.HostId)
                {
                    cbxType.SelectedIndex = i;
                    break;
                }
            }
            cbxType_SelectedIndexChanged(this, EventArgs.Empty);
        }
Beispiel #2
0
        public void Init(BusManager bmgr, IHostService host, IJoystickDevice device)
        {
            m_bmgr   = bmgr;
            m_host   = host;
            m_device = device;

            cbxType.Items.Clear();
            if (m_host != null && m_host.Joystick != null)
            {
                foreach (var hdi in m_host.Joystick.GetAvailableJoysticks())
                {
                    cbxType.Items.Add(hdi);
                }
            }
            //cbxType.Sorted = true;

            cbxType.SelectedIndex = -1;
            for (var i = 0; i < cbxType.Items.Count; i++)
            {
                var hdi = (IHostDeviceInfo)cbxType.Items[i];
                if (m_device.HostId == hdi.HostId)
                {
                    cbxType.SelectedIndex = i;
                    break;
                }
            }
            cbxType_SelectedIndexChanged(this, EventArgs.Empty);
        }