Example #1
0
        /// <summary>
        /// 创建资源更新失败事件。
        /// </summary>
        /// <param name="name">资源名称。</param>
        /// <param name="downloadUri">下载地址。</param>
        /// <param name="retryCount">已重试次数。</param>
        /// <param name="totalRetryCount">设定的重试次数。</param>
        /// <param name="errorMessage">错误信息。</param>
        /// <returns>创建的资源更新失败事件。</returns>
        /// <remarks>当已重试次数达到设定的重试次数时,将不再重试。</remarks>
        public static IResourceUpdateFailureEventArgs Create(string name, string downloadUri, int retryCount, int totalRetryCount, string errorMessage)
        {
            IResourceUpdateFailureEventArgs resourceUpdateFailureEventArgs = ReferencePool.Acquire <IResourceUpdateFailureEventArgs>();

            resourceUpdateFailureEventArgs.Name            = name;
            resourceUpdateFailureEventArgs.DownloadUri     = downloadUri;
            resourceUpdateFailureEventArgs.RetryCount      = retryCount;
            resourceUpdateFailureEventArgs.TotalRetryCount = totalRetryCount;
            resourceUpdateFailureEventArgs.ErrorMessage    = errorMessage;
            return(resourceUpdateFailureEventArgs);
        }
Example #2
0
 private void OnResourceUpdateFailure(object sender, IResourceUpdateFailureEventArgs e)
 {
     EventComponent.This.Fire(this, ResourceUpdateFailureEventArgs.Create(e));
 }