Esempio n. 1
0
        TKDropDown getCombo(List <string> ports, int selected, bool AddDoNothing)
        {
            TKDropDown box = new TKDropDown();

            List <object> items = new List <object>();

            if (AddDoNothing)
            {
                items.Add("Do nothing");
            }

            foreach (string port in ports)
            {
                if (!items.Contains(port))
                {
                    items.Add(port);
                }
            }

            box.Items         = items;
            box.SelectedIndex = selected;

            return(box);
        }
Esempio n. 2
0
        public void Init(string Caption, List <string> OldValues, List <string> RemapValues)
        {
            Text = Caption;

            this.panelLeft.Controls.Clear();
            this.panelRight.Controls.Clear();
            for (int i = 0; i < OldValues.Count; i++)
            {
                TKDropDown box = getCombo(OldValues, i, false);
                this.panelLeft.Controls.Add(box);
                refs.Add(box);
                box.Dock = DockStyle.Top;
                box.BringToFront();
            }

            for (int i = 0; i < RemapValues.Count; i++)
            {
                TKDropDown box = getCombo(RemapValues, 0, true);
                this.panelRight.Controls.Add(box);
                maps.Add(box);
                box.Dock = DockStyle.Top;
                box.BringToFront();
            }
        }