예제 #1
0
        private void OnPlatformContextMenuItemTriggered(ZoomContextMenuItem item)
        {
            var selected_platform = (Platform)platformsListMain.SelectedObject;

            switch (item.ActionType)
            {
            case ZoomContextMenuItem.Type.AssignEmu:

                Library.Platforms[selected_platform.PlatformId].EmulatorId  = (int)item.Tag1;
                Library.Platforms[selected_platform.PlatformId].LaunchArgId = (int)item.Tag2;
                Library.MarkDirty();

                break;

            case ZoomContextMenuItem.Type.DeletePlatform:

                if (MessageBox.Show("Are you sure ? Every trace of this Platform and all its roms and their images, if any, will be erased.", "Confirm Delete", MessageBoxButtons.OKCancel) == DialogResult.OK)
                {
                    Library.RemovePlatform(selected_platform);

                    platformsListMain.RemoveObject(selected_platform);

                    UpdateRomsList();
                }

                break;
            }
        }
예제 #2
0
        private void OnEmuContextMenuItemSelected(ZoomContextMenuItem item)
        {
            _assigned_emu_id        = (int)item.Tag1;
            _assigned_launch_arg_id = (int)item.Tag2;

            UpdateEmuBtnLabel();
        }
예제 #3
0
        private void OnRomContextMenuItemTriggered(ZoomContextMenuItem item)
        {
            switch (item.ActionType)
            {
            case ZoomContextMenuItem.Type.DeleteRom:

                DeleteRomScanResult((Rom)detectedRoms.SelectedObject);

                break;
            }
        }
예제 #4
0
        private void OnCreatePlatformContextMenuItemSelected(ZoomContextMenuItem item)
        {
            switch (item.ActionType)
            {
            case ZoomContextMenuItem.Type.SetPlatform:

                var selected_unrecognized_directory = (DirectoryInfo)listUnrecognized.SelectedObject;

                var selected_platform_id = (PlatformId)item.Tag1;

                AddNewAssignedPlatform(selected_unrecognized_directory, selected_platform_id);

                break;
            }
        }
예제 #5
0
        private void OnRomContextMenuItemTriggered(ZoomContextMenuItem item)
        {
            var selected_rom = (Rom)romsListMain.SelectedObject;

            switch (item.ActionType)
            {
            case ZoomContextMenuItem.Type.AssignRomImage:

                if (romImageFileDialog.ShowDialog() == DialogResult.OK)
                {
                    try
                    {
                        Library.SetRomImage(selected_rom, romImageFileDialog.FileName);

                        romsListMain.RefreshSelectedObjects();
                    }
                    catch (Exception e)
                    {
                        MessageBox.Show($"Error while trying to assign image rom: {e.Message}", "Error",
                                        MessageBoxButtons.OK);
                    }
                }

                break;

            case ZoomContextMenuItem.Type.ClearImage:

                Library.ClearRomImage(selected_rom);

                romsListMain.RefreshSelectedObjects();

                break;

            case ZoomContextMenuItem.Type.DeleteRom:

                if (MessageBox.Show("Are you sure ? Every trace of this rom will be erased.", "Confirm Delete", MessageBoxButtons.OKCancel) == DialogResult.OK)
                {
                    Library.RemoveRom(selected_rom);

                    romsListMain.RemoveObject(selected_rom);
                }

                break;
            }
        }