private void Form1_Load(object sender, EventArgs e) { WallbaseImageSearchSettings wiss = new WallbaseImageSearchSettings(); wiss.SA = "toplist"; PictureSearch ps = new PictureSearch(); ps.SearchProvider = new ActiveProviderInfo("Wallbase") { Active = true, ProviderConfig = wiss.Save() }; ps.MaxPictureCount = 100; string path = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), "TEMP"); Directory.CreateDirectory(path); ps.SaveFolder = path; IInputProvider p = ps.SearchProvider.Instance as IInputProvider; pl = p.GetPictures(ps); Timer t = new Timer(); t.Tick += t_Tick; t.Interval = 5000; t.Enabled = true; }
public void LoadConfiguration(string config) { try { if(!string.IsNullOrEmpty(config)) wiss = WallbaseImageSearchSettings.LoadFromXML(config); } catch { } if (wiss == null) wiss = new WallbaseImageSearchSettings(); txtUserID.Text = wiss.Username; txtPassword.Text = wiss.Password; txtSearch.Text = wiss.Query; cbArea.SelectedValue = wiss.SA; cbWG.Checked = wiss.WG; cbW.Checked = wiss.W; cbHR.Checked = wiss.HR; cbSFW.Checked = wiss.SFW; cbSketchy.Checked = wiss.SKETCHY; cbNSFW.Checked = wiss.NSFW; cbImageSizeType.SelectedValue = wiss.SO; cbOrderBy.SelectedValue = wiss.OB; cbOrderByDirection.SelectedValue = wiss.OBD; txtWidth.Text = wiss.ImageWidth.ToString(); txtHeight.Text = wiss.ImageHeight.ToString(); cbAspectRatio.SelectedValue = wiss.AR; txtCollectionID.Text = wiss.CollectionID; txtFavoritesID.Text = wiss.FavoriteID; cbTopTimespan.SelectedValue = wiss.TopTimespan; if (wiss.Color != System.Drawing.Color.Empty) { pnlColor.BackColor = wiss.Color; cdPicker.Color = wiss.Color; } }
private void Form1_Load(object sender, EventArgs e) { WallbaseImageSearchSettings wiss = new WallbaseImageSearchSettings(); wiss.SA="toplist"; PictureSearch ps = new PictureSearch(); ps.SearchProvider = new ActiveProviderInfo("Wallbase") {Active=true, ProviderConfig = wiss.Save()}; ps.MaxPictureCount = 100; string path = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), "TEMP"); Directory.CreateDirectory(path); ps.SaveFolder = path; IInputProvider p = ps.SearchProvider.Instance as IInputProvider; pl = p.GetPictures(ps); Timer t = new Timer(); t.Tick += t_Tick; t.Interval = 5000; t.Enabled = true; }