protected override object GetElementKey(ConfigurationElement element)
        {
            ServerConfigurationElement typedElement = element as ServerConfigurationElement;

            if (typedElement == null)
            {
                return(null);
            }
            return(typedElement.Name);
        }
Esempio n. 2
0
        private bool TryGetSelectedServer(out ServerConfigurationElement emulator, out HostConfigurationElement server)
        {
            if (TryGetSelectedEmulator(out emulator) == false)
            {
                server = null;
                return false;
            }
            else if (c_ComboBox_Servers.SelectedIndex == -1 && m_LastSelectedServer == null)
            {
                server = null;
                return false;
            }
            else if (c_ComboBox_Servers.SelectedIndex == -1 && m_LastSelectedServer != null)
            {
                server = m_LastSelectedServer;
                return true;
            }

            string serverName = c_ComboBox_Servers.SelectedItem.ToString();
            server = emulator.Hosts.GetByHostName(serverName);
            return true;
        }
Esempio n. 3
0
        private bool TryGetSelectedEmulator(out ServerConfigurationElement server)
        {
            server = CurrentSelectedServer;
            return (server != null);
            //if (c_ComboBox_Emulators.SelectedIndex == -1)
            //{
            //    server = null;
            //    return false;
            //}

            //string emulatorName = c_ComboBox_Emulators.SelectedItem.ToString();
            //server = Program.Configuration.Servers[emulatorName];
            //return true;
        }