private void Entrance_MouseDown(object sender, MouseEventArgs e) { if (dropMode == DropMode.Move) { DoDragDrop(this, DragDropEffects.All); } else { Entrance entrance = new Entrance(); entrance.Location = new Point(17, 17); DoDragDrop(entrance, DragDropEffects.Move); } }
private void Dungeon_DragDrop(object sender, DragEventArgs e) { if (e.Data.GetData(typeof(Room)) != null) { Room room = (Room)e.Data.GetData(typeof(Room)); room.Dispose(); } if (e.Data.GetData(typeof(Entrance)) != null) { Entrance entrance = (Entrance)e.Data.GetData(typeof(Entrance)); entrance.Dispose(); } }