Пример #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();
             }
         }
     }
 }
Пример #2
0
 /// <summary>
 /// Agrega un nuevo tipo de objeto.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void menuAddNewItem_Click(object sender, EventArgs e)
 {
     editItemDialog = new DlgEditItem(itemList);
     if (editItemDialog.ShowDialog() == DialogResult.OK)
     {
         UpdateItemList();
     }
 }