Exemplo n.º 1
0
        static public int GetPageCount(IPicElement pe)
        {
            WebClient wc = new WebClient();

            wc.Encoding = Encoding.UTF8;
            wc.DownloadStringCompleted += wc_dasil;
            return(HitomiGalleryInfo.GetImageLink(wc.DownloadString(new Uri(HitomiDef.HitomiGalleryAddress + pe.Article.Magic + ".js"))).Count);
        }
Exemplo n.º 2
0
        public frmGalleryInfo(Form closed, IPicElement pic)
        {
            InitializeComponent();

            this.pic    = pic;
            closed_form = closed;
            id          = pic.Article.Magic;
            CloseOnRBtn = new RightClickCloser(this);
        }
Exemplo n.º 3
0
        static public void DownloadAndSetImageLink(IPicElement pe, CallBack callback)
        {
            WebClient wc = new WebClient();

            wc.Encoding = Encoding.UTF8;
            wc.DownloadStringCompleted += wc_dasil;
            wc.DownloadStringAsync(new Uri(HitomiDef.HitomiGalleryAddress + pe.Article.Magic + ".js"),
                                   new Tuple <IPicElement, CallBack>(pe, callback));
        }
Exemplo n.º 4
0
 private void ImageLinkCallback(IPicElement pe)
 {
     download_queue = new HitomiQueue(Notify, Notify_Size, Notify_Status, Notify_Retry);
     PBMaxSize(pe.Article.ImagesLink.Count);
     for (int i = 0; i < pe.Article.ImagesLink.Count; i++)
     {
         string temp = Path.GetTempFileName();
         download_queue.Add(HitomiDef.GetDownloadImageAddress(pe.Article.Magic, pe.Article.ImagesLink[i]), temp, i);
     }
 }
Exemplo n.º 5
0
        private void ImageLinkCallback(IPicElement pe)
        {
            download_queue = new HitomiQueue(Notify, Notify_Size, Notify_Status, Notify_Retry);
            int max = pe.Article.ImagesLink.Count;

            if (HitomiSetting.Instance.GetModel().LoadPreviewMaximum < max)
            {
                max = HitomiSetting.Instance.GetModel().LoadPreviewMaximum;
            }
            PBMaxSize(max);
            for (int i = 0; i < max; i++)
            {
                string temp = Path.GetTempFileName();
                download_queue.Add(HitomiDef.GetDownloadImageAddress(pe.Article.Magic, pe.Article.ImagesLink[i]), temp, i);
            }
        }