Esempio n. 1
0
        private void tmrProgress_Tick(object sender, EventArgs e)
        {
            if (this._twitterDownloader != null)
            {
                ProgressC progress = this._twitterDownloader.Progress;
                switch (progress.Type)
                {
                case ProgressType.GettingImages:
                    this.lblInfo.Text = string.Format(strings.GettingImages, progress.Page);
                    this.pb1.Style    = ProgressBarStyle.Marquee;
                    break;

                case ProgressType.DownloadingImages:
                    this.lblInfo.Text = strings.DownloadingImages;
                    this.pb1.Style    = ProgressBarStyle.Blocks;
                    this.pb1.Maximum  = progress.MaxProgress;
                    this.pb1.Value    = progress.CurrentProgress;
                    break;
                }
                this.lblImgFound.Text      = strings.Found + progress.MaxProgress;
                this.lblImgDownloaded.Text = strings.Downloaded + progress.Downloaded;
                this.lblImgErrors.Text     = strings.Errors + this._twitterDownloader.ErrorsLinks.Count;
            }
            this.AutoPosLabels();
            if (this._possibleProgressInTaskBar)
            {
                this.pb1.SetTaskbarProgress();
            }
        }
Esempio n. 2
0
        public TwitterDownloader()
        {
            try
            {
                Xpcom.Initialize(Application.StartupPath + @"\xulrunner\");
            }
            catch (Exception exception)
            {
                throw new Exception(exception.Message);
            }

            this._webBrowser = new GeckoWebBrowser {
                Dock = DockStyle.Fill
            };
            this._webClient    = new WebClient();
            this.Progress      = new ProgressC();
            this._loadingTimer = new Timer {
                Interval = 6500
            };
            this._loadingTimer.Tick += this._loadingTimer_Tick;
            this._loading            = false;
            this.ErrorsLinks         = new List <string>();

            #region Изврат

            // иначе не работает скролл :(
            this._justForm = new Form();
            this._justForm.Controls.Add(this._webBrowser);

            #endregion
        }