Exemplo n.º 1
0
 internal void Initialize(ToolSet toolSet)
 {
     if (toolSet.Slots.Count > 0)
     {
         textBox1.Text = FormatToolNumber(toolSet.Slots[0].Name);
         BindToolList(comboBox1, toolSet, 0);
     }
     if (toolSet.Slots.Count > 1)
     {
         textBox2.Text = FormatToolNumber(toolSet.Slots[1].Name);
         BindToolList(comboBox2, toolSet, 1);
     }
     if (toolSet.Slots.Count > 2)
     {
         textBox3.Text = FormatToolNumber(toolSet.Slots[2].Name);
         BindToolList(comboBox3, toolSet, 2);
     }
     if (toolSet.Slots.Count > 3)
     {
         textBox4.Text = FormatToolNumber(toolSet.Slots[3].Name);
         BindToolList(comboBox4, toolSet, 3);
     }
     if (toolSet.Slots.Count > 4)
     {
         textBox5.Text = FormatToolNumber(toolSet.Slots[4].Name);
         BindToolList(comboBox5, toolSet, 4);
     }
 }
Exemplo n.º 2
0
 private void BindToolList(ComboBox comboBox, ToolSet toolSet, int index)
 {
     List<string> tools = new List<string>();
     foreach (Tool t in toolSet.Tools)
         tools.Add(t.Name);
     comboBox.DataSource = tools;
     comboBox.SelectedItem = toolSet.Slots[index].Tool.Name;
 }