Example #1
0
 private void combo_left_DropDownClosed(object sender, EventArgs e)
 {
     try
     {
         if (NODE.combo_left_chamf.SelectedItem.ToString() == "no feature")
         {
             /*int ID = NODE.NodePosition;
              * ID += 1;
              * ID *= 2;
              * ID -= 2;
              * var_es.chamfer_list.RemoveAt(ID);
              * var_es.chamfer_list.Insert(ID, new chamf());*/
         }
         if (NODE.combo_left_chamf.SelectedItem.ToString() == "Fillet")
         {
             try
             {
                 int id = (NODE.NodePosition + 1) * 2;
                 id -= 2;
                 if (!var_es.chamfer_list[id].IsNullorEmpty())
                 {
                     addInForm.NODES[ID].RemoveAt(var_es.chamfer_list[id].Node_Position);
                     addInForm.nodes.RemoveAt(var_es.chamfer_list[id].Node_Position);
                     addInForm.buttonTree1.ReLoad();
                     var_es.chamfer_list[id] = new chamf();
                 }
             }
             catch { }
             Filler filler_from = new Filler('l', NODE.NodePosition);
             filler_from.Owner = this;
             filler_from.ShowDialog();
             if (!Filler.canceled)
             {
                 addInForm.buttonTree1.ReLoad();
                 addInForm.NODES[addInForm.NODES.Count - 1].combo_left_chamf.SelectedItem = "Fillet";
             }
         }
         if (NODE.combo_left_chamf.SelectedItem.ToString() == "Chamfer")
         {
             try
             {
                 int id = (NODE.NodePosition + 1) * 2;
                 id -= 2;
                 if (!var_es.chamfer_list[id].IsNullorEmpty())
                 {
                     addInForm.NODES[ID].RemoveAt(var_es.chamfer_list[id].Node_Position);
                     addInForm.nodes.RemoveAt(var_es.chamfer_list[id].Node_Position);
                     addInForm.buttonTree1.ReLoad();
                     var_es.chamfer_list[id] = new chamf();
                 }
             }
             catch { }
             chamfer chamf_foorm = new chamfer('l', NODE.NodePosition);
             chamf_foorm.Owner = this;
             chamf_foorm.ShowDialog();
             if (!chamfer.canceled)
             {
                 addInForm.buttonTree1.ReLoad();
                 addInForm.NODES[addInForm.NODES.Count - 1].combo_left_chamf.SelectedItem = "Chamfer";
             }
         }
     }
     catch (Exception) { MessageBox.Show("You have to change somethig"); }
 }