⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 retryactivity.cs

📁 破解的飞信源代码
💻 CS
字号:
namespace Imps.Client.Core.Login
{
    using Imps.Client.Core;
    using System;

    public class RetryActivity
    {
        internal readonly LoginAction _action;
        private int _failedTimes;
        private const int MAX_FAIL_TIMES = 3;

        public RetryActivity(LoginAction action)
        {
            this._action = action;
            this._failedTimes = 0;
        }

        public bool Execute()
        {
            try
            {
                RetryResult result = new RetryResult();
                this._action.Retry(result);
                if (result.IsCompleted)
                {
                    return false;
                }
                if (!result.IsSucceed)
                {
                    this._failedTimes++;
                }
                else
                {
                    this._failedTimes = 0;
                }
            }
            catch
            {
                this._failedTimes++;
            }
            if (this.FailedTimes >= 3)
            {
                return false;
            }
            return true;
        }

        internal int FailedTimes
        {
            get
            {
                return this._failedTimes;
            }
        }
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -