private void btn_Load_Click(object sender, EventArgs e) { OpenFileDialog ofd = new OpenFileDialog(); ofd.Filter = "dat File|*.dat"; if (ofd.ShowDialog() == System.Windows.Forms.DialogResult.OK) { var mvs = ArtMovieSaveLoad.Load(ofd.FileName); if (mvs.Count > 0) { this.AllList.Clear(); this.AllList = mvs; } } }
private void btn_Save_Click(object sender, EventArgs e) { SaveFileDialog sfd = new SaveFileDialog(); sfd.Filter = "dat file|*.dat"; if (sfd.ShowDialog() == System.Windows.Forms.DialogResult.OK) { if (ArtMovieSaveLoad.Save(sfd.FileName, this.AllList)) { MessageBox.Show("Saved!", "信息", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { } } }
void MainWorker_DoWork(object sender, DoWorkEventArgs e) { var fun = e.Argument as Func <int, List <ArtMovie> >; var scraper = fun.Target as IMovieScraper; var pageTo = (int)nud_scraper_page.Value; scraper.IsDownloadCoverPicture = cb_scraper_pic1.Checked; scraper.IsDownloadExtraPicture = cb_scraper_pic2.Checked; scraper.CompleteOneItem += scraper_CompleteOneItem; for (int i = 1; i <= pageTo; i++) { fun.Invoke(i); } ArtMovieSaveLoad.Save(AppDomain.CurrentDomain.BaseDirectory + "\\" + scraper.DisplayName + "_AutoSave" + DateTime.Now.ToString("yyyyMMddHHmmss") + ".dat", AllList); }