private void VerifyThreading()
        {
            Exception exception = null;

            try
            {
                this.Verifing      = true;
                this.VerifySuccess = false;
                this.ImageLimit    = null;
                ControlUtils.InvokeFNeeded(this, this.UpdateVerifyControl);

                var account            = this.ParseAccount();
                var webRequestProvider = new WebRequestProvider()
                {
                    Timeout = 0
                };
                var func   = ExHentaiAgent.UnaryRequestParameter(webRequestProvider.CreateRequestParameter, account);
                var result = ExHentaiAgent.CheckAccount(webRequestProvider.Explorer, func);

                this.VerifySuccess = result;

                if (result == true)
                {
                    this.ImageLimit = ExHentaiAgent.GetImageLimit(webRequestProvider.Explorer, func);
                }
            }
            catch (Exception e)
            {
                this.VerifySuccess = false;
                exception          = e;
            }
            finally
            {
                this.Verifing = false;

                try
                {
                    this.InvokeFNeeded(this.UpdateVerifyControl);
                }
                catch (Exception)
                {
                }

                this.VerifyThread = null;
            }

            if (exception != null)
            {
                var dd = DoujinshiDownloader.Instance;
                dd.ShowCrashMessageBox(exception);
            }
        }
Example #2
0
        public void Bind(ImageLimit value)
        {
            var imageLimitLabel = this.ImageLimitLabel;

            if (value == null)
            {
                imageLimitLabel.Text = SR.Get("Settings.ExHentaiAccount.Information.None");
            }
            else
            {
                var map = new Dictionary <string, string>
                {
                    ["Current"] = value.Current.ToString(),
                    ["Limit"]   = value.Limit.ToString(),
                };

                imageLimitLabel.Text = SR.Get("Settings.ExHentaiAccount.Information.ImageLimit", map);
            }
        }