Exemplo n.º 1
0
            //emulator stuff

            public ComboBoxItemDevice(Debugger.PortDefinition pd)
                : base(pd.DisplayName, pd.PersistName, pd is PortDefinition_Tcp)
            {
                m_pd = pd;
            }
Exemplo n.º 2
0
        private void InitializeDeployDevice(Debugger.PortDefinition selected)
        {
            //What about EmulatorExe????

            int       iSelected = -1;
            DebugPort port      = this.SelectedDeployPort;

            if (port == null)
            {
                return;
            }

            PortDefinition[] portDefinitions;

            if (port.IsLocalPort)
            {
                PlatformInfo platformInfo = this.VsProjectFlavorCfg.PlatformInfo;

                PlatformInfo.Emulator[] emulators = platformInfo.Emulators;

                portDefinitions = new PortDefinition[emulators.Length];

                for (int i = 0; i < emulators.Length; i++)
                {
                    portDefinitions[i] = new PlatformInfo.PortDefinition_PeristableEmulator(emulators[i]);
                }
            }
            else
            {
                portDefinitions = port.GetPersistablePortDefinitions();
            }

            m_cbDeployDevice.Items.Clear();

            for (int iPortDefinition = 0; iPortDefinition < portDefinitions.Length; iPortDefinition++)
            {
                PortDefinition pd = portDefinitions[iPortDefinition];

                ComboBoxItemDevice cbi = new ComboBoxItemDevice(pd);
                m_cbDeployDevice.Items.Add(cbi);

                if (Object.Equals(selected, pd))
                {
                    iSelected = m_cbDeployDevice.Items.Count - 1;
                }
            }

            if (m_cbDeployDevice.Items.Count == 0)
            {
                if (selected != null && port.PortFilter == PortFilter.TcpIp && selected is PortDefinition_Tcp)
                {
                    m_cbDeployDevice.Items.Add(new ComboBoxItemDevice(selected));
                }
                else
                {
                    ComboBoxItemDevice cbi = new ComboBoxItemDevice("<none>");
                    m_cbDeployDevice.Items.Insert(0, cbi);
                }
                iSelected = 0;
            }

            if (port.PortFilter != PortFilter.TcpIp)
            {
                iSelected = 0;
            }

            if (iSelected != -1)
            {
                m_cbDeployDevice.SelectedIndex = iSelected;
            }
        }