예제 #1
0
        private void btnDownloadTags_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrWhiteSpace(txtTags.Text))
            {
                MessageBox.Show("Please specify tags to download.");
                return;
            }

            string[] length = txtTags.Text.Split(' ');
            if (length.Length > 6)
            {
                MessageBox.Show("6 tags is the maximum length you're allowed to download from e621. If your tag has a space between words, be sure to add an underscore. (_)");
                return;
            }
            string NewTags = txtTags.Text;

            if (NewTags.StartsWith(" "))
            {
                NewTags = NewTags.TrimStart(' ');
            }
            if (NewTags.EndsWith(" "))
            {
                NewTags = NewTags.TrimEnd(' ');
            }
            if (NewTags.Contains("/"))
            {
                NewTags = NewTags.Replace("/", "%25-2F");
            }

            TagDownloadInfo NewInfo = new TagDownloadInfo(NewTags);

            NewInfo.PageLimit              = (int)numTagsPageLimit.Value;
            NewInfo.UseMinimumScore        = chkTagsUseMinimumScore.Checked;
            NewInfo.MinimumScoreAsTag      = chkTagsUseScoreAsTag.Checked;
            NewInfo.MinimumScore           = (int)numTagsMinimumScore.Value;
            NewInfo.ImageLimit             = (int)numTagsImageLimit.Value;
            NewInfo.SaveExplicit           = chkTagsDownloadExplicit.Checked;
            NewInfo.SaveQuestionable       = chkTagsDownloadQuestionable.Checked;
            NewInfo.SaveSafe               = chkTagsDownloadSafe.Checked;
            NewInfo.SeparateRatings        = chkTagsSeparateRatings.Checked;
            NewInfo.SeparateNonImages      = chkTagSeparateNonImages.Checked;
            NewInfo.OpenAfter              = chkTagsOpenAfterDownload.Checked;
            NewInfo.DownloadNewestToOldest = chkTagsDownloadInUploadOrder.Checked;
            frmTagDownloader Downloader = new frmTagDownloader();

            Downloader.DownloadInfo = NewInfo;
            Downloader.Show();
        }
예제 #2
0
            public static bool DownloadPage(string PageUrl, bool UseDialog = true)
            {
                try {
                    frmTagDownloader tagDL = new frmTagDownloader();
                    tagDL.DownloadInfo = new TagDownloadInfo(true, PageUrl);
                    switch (UseDialog)
                    {
                    case true:
                        tagDL.ShowDialog();
                        break;

                    case false:
                        tagDL.Show();
                        break;
                    }
                    return(true);
                }
                catch {
                    throw;
                }
            }