public Wzd_NewEmu_Main(IPlatformImporter platformImporter)
 {
     InitializeComponent();
     this.Text = "New Emulator";
     panels = new List<WzdPanel>(new WzdPanel[] { new Wzd_NewEmu_Start(this), new Wzd_NewEmu_Info(this, platformImporter), new Wzd_NewEmu_Config(this), new Wzd_NewEmu_Config2(this), new Wzd_NewEmu_Roms(this) });
     panel1.Controls.Add(panels[0]);
     updateButtons();
 }
 public Conf_EmuThumbRetriever(Emulator emu, IPlatformImporter platformImporter)
 {
     InitializeComponent();
     this.emu = emu;
     this.platformImporter = platformImporter;
     currentImages = new List<Image>();
     resultsComboBox.DisplayMember = "Name"; 
     resultsComboBox.DropDownClosed += new EventHandler(resultsComboBox_DropDownClosed);            
     clearStatusInfo();
 }
 public Wzd_NewEmu_Info(Wzd_NewEmu_Main parent, IPlatformImporter platformImporter)
 {
     InitializeComponent();
     platformComboBox.DisplayMember = "Name";
     var platforms = Dropdowns.GetPlatformList();
     foreach (Platform platform in platforms)
         platformComboBox.Items.Add(platform);
     txt_Title.Text = "New Emulator";
     this.parent = parent;
     this.platformImporter = platformImporter;
 }
        static PlatformInfo getPlatformInfo(string platform, Platform selectedPlatform, IPlatformImporter importer, Func<PlatformInfo, bool> completedDelegate)
        {
            PlatformInfo platformInfo = null;
            bool completed = false;

            BackgroundTaskHandler handler = new BackgroundTaskHandler();
            handler.ActionDelegate = () =>
            {
                handler.ExecuteProgressHandler("Looking up platforms...", 0);
                if (selectedPlatform == null)
                    selectedPlatform = importer.GetPlatformByName(platform);
                if (selectedPlatform != null)
                {
                    handler.ExecuteProgressHandler("Retrieving info for " + platform, 33);
                    platformInfo = importer.GetPlatformInfo(selectedPlatform.Id);
                    if (platformInfo != null)
                    {
                        handler.ExecuteProgressHandler("Updating " + platformInfo.Title, 67);
                        completed = completedDelegate == null ? true : completedDelegate(platformInfo);
                    }
                }
            };

            using (Conf_ProgressDialog progressDlg = new Conf_ProgressDialog(handler))
                progressDlg.ShowDialog();

            if (completed)
                return platformInfo;

            if (selectedPlatform == null)
            {
                var platforms = importer.GetPlatformList();
                if (platforms.Count != 0)
                {
                    using (Conf_EmuLookupDialog lookupDlg = new Conf_EmuLookupDialog(platforms))
                    {
                        if (lookupDlg.ShowDialog() == DialogResult.OK && lookupDlg.SelectedPlatform != null)
                            return getPlatformInfo(lookupDlg.SelectedPlatform.Name, lookupDlg.SelectedPlatform, importer, completedDelegate);
                    }
                }
            }
            else
            {
                MessageBox.Show("Error retrieving online info.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            return null;
        }
 public static PlatformInfo GetPlatformInfo(string platform, IPlatformImporter platformImporter, Func<PlatformInfo, bool> completedDelegate)
 {
     return getPlatformInfo(platform, null, platformImporter, completedDelegate);
 }
 public PlatformDetailsModel()
 {
     importer = new TheGamesDBImporter();
 }
 public EmulatorImageDownloader(IPlatformImporter platformImporter)
 {
     this.platformImporter = platformImporter;
 }