Esempio n. 1
0
 /// <summary>
 /// Permite modificar las propiedades del tipo de objeto seleccionado.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void pboxItemPreview_Click(object sender, EventArgs e)
 {
     if (lstItems.SelectedIndex > -1 && lstItems.SelectedIndex < itemList.Count)
      {
     if (itemList[lstItems.SelectedIndex] is Components.Robot)
     {
        editRobotDialog = new DlgEditRobot((Components.Robot)itemList[lstItems.SelectedIndex]);
        if (editRobotDialog.ShowDialog() == DialogResult.OK)
        {
           int selected = lstItems.SelectedIndex;
           UpdateItemList();
           lstCells.SelectedIndex = selected;
           pboxGrid.Invalidate();
        }
     }
     else
     {
        editItemDialog = new DlgEditItem(itemList[lstItems.SelectedIndex]);
        if (editItemDialog.ShowDialog() == DialogResult.OK)
        {
           int selected = lstItems.SelectedIndex;
           UpdateItemList();
           lstCells.SelectedIndex = selected;
           pboxGrid.Invalidate();
        }
     }
      }
 }
Esempio n. 2
0
 /// <summary>
 /// Permite crear un nuevo robot.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void menuAddNewRobot_Click(object sender, EventArgs e)
 {
     editRobotDialog = new DlgEditRobot(itemList);
      if (editRobotDialog.ShowDialog() == DialogResult.OK)
     UpdateItemList();
 }