using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using static System.Windows.Forms.VisualStyles.VisualStyleElement;


namespace SSH_Test
{
    public partial class FormProfile : Form
    {
        public string sProfile { get; set; }
        public FormProfile(string sProfile)
        {
            InitializeComponent();
            this.sProfile = sProfile;
            if (sProfile != null) sProfile = "Cisco_Switch";
                        
            int index = comboBoxProfile.FindStringExact(sProfile);

            // If the item is found, set it as the selected item
            if (index != -1)
            {
                comboBoxProfile.SelectedIndex = index;
            }
            else
            {
                
                comboBoxProfile.SelectedIndex = 0; 
            }
        }

        private void bOK_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void comboBoxProfile_TextChanged(object sender, EventArgs e)
        {
            Console.WriteLine("Profile changes to: {0}", comboBoxProfile.SelectedItem.ToString());
            sProfile = comboBoxProfile.SelectedItem.ToString();
        }
    }
}
