private void HostConfigurationWindow(IProviderConfigurationEditor initSettings, ActiveProviderInfo api) { //dialog window which will house the user control ProviderSettingsWindow psw = new ProviderSettingsWindow(); Bitmap img = (Bitmap)ProviderManager.GetProviderIcon(api.Instance.GetType()); if (img != null) { psw.Icon = System.Drawing.Icon.FromHandle(img.GetHicon()); img.Dispose(); } //load the usercontrol into the window psw.LoadSettings(initSettings, api.ProviderName); //get current config string //load the configuration info into the user control initSettings.LoadConfiguration(api.ProviderConfig); //show the dialog box psw.ShowDialog(); //if user clicked OK then call save to keep a copy of settings in memory if (initSettings.IsOK) { api.ProviderConfig = initSettings.SaveConfiguration(); //activate apply option ApplyButton.Enabled = true; } }
private void button1_Click(object sender, EventArgs e) { PictureSearch ps = new PictureSearch(); ps.SearchProvider = new ActiveProviderInfo(providerComboBox1.SelectedItem.ToString()) { Active = true, ProviderConfig = _current.SaveConfiguration() }; ps.MaxPictureCount = (int)numericUpDown1.Value; ps.SaveFolder = txtDownloadPath.Text; IInputProvider p = ps.SearchProvider.Instance as IInputProvider; var pl = p.GetPictures(ps); PictureBatch pb = new PictureBatch(); pb.AllPictures.Add(pl); DownloadManager.Current.SaveFolder = txtDownloadPath.Text; DownloadManager.Current.PreFetchFiles(pb); }