예제 #1
0
        private void InitializeDeployDevice(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;
            }
        }
        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;
            }
                
        }