Example #1
0
        private void removeObject()
        {
            var confirmResult = System.Windows.Forms.MessageBox.Show("Are you sure to delete this item?", "Confirm Delete!", System.Windows.Forms.MessageBoxButtons.YesNo);

            if (confirmResult == System.Windows.Forms.DialogResult.Yes)
            {
                switch (placementType)
                {
                case PlacementType.BlockPlacement:
                    BlockType.lookup.Remove(((BlockListItem)manageObjectList.SelectedElement).BlockType.ID);
                    manageObjectList.RemoveElement(manageObjectList.SelectedElement);
                    break;

                case PlacementType.AmbientObjectPlacement:
                    AmbientObjectType.lookup.Remove(((AmbientObjectListItem)manageObjectList.SelectedElement).AmbientObjectType.ID);
                    manageObjectList.RemoveElement(manageObjectList.SelectedElement);
                    break;

                case PlacementType.AmbientHitableObjectPlacement:
                    AmbientHitableObjectType.lookup.Remove(((AmbientHitableObjectListItem)manageObjectList.SelectedElement).AmbientHitableObjectType.ID);
                    manageObjectList.RemoveElement(manageObjectList.SelectedElement);
                    break;

                case PlacementType.LivingEntityPlacement:
                    LivingEntityType.lookup.Remove(((LivingEntityListItem)manageObjectList.SelectedElement).LivingEntityType.ID);
                    manageObjectList.RemoveElement(manageObjectList.SelectedElement);
                    break;
                }
            }
        }