//------------------------------------------------------------ // Game Framework // Copyright © 2013-2021 loyalsoft. All rights reserved. // Homepage: http://www.game7000.com/ // Feedback: http://www.game7000.com/ //------------------------------------------------------------ namespace GameFramework.Download { /// /// 下载成功事件。 /// public sealed class DownloadSuccessEventArgs : GameFrameworkEventArgs { /// /// 初始化下载成功事件的新实例。 /// public DownloadSuccessEventArgs() { SerialId = 0; DownloadPath = null; DownloadUri = null; CurrentLength = 0L; UserData = null; } /// /// 获取下载任务的序列编号。 /// public int SerialId { get; private set; } /// /// 获取下载后存放路径。 /// public string DownloadPath { get; private set; } /// /// 获取下载地址。 /// public string DownloadUri { get; private set; } /// /// 获取当前大小。 /// public long CurrentLength { get; private set; } /// /// 获取用户自定义数据。 /// public object UserData { get; private set; } /// /// 创建下载成功事件。 /// /// 下载任务的序列编号。 /// 下载后存放路径。 /// 下载地址。 /// 当前大小。 /// 用户自定义数据。 /// 创建的下载成功事件。 public static DownloadSuccessEventArgs Create(int serialId, string downloadPath, string downloadUri, long currentLength, object userData) { DownloadSuccessEventArgs downloadSuccessEventArgs = ReferencePool.Acquire(); downloadSuccessEventArgs.SerialId = serialId; downloadSuccessEventArgs.DownloadPath = downloadPath; downloadSuccessEventArgs.DownloadUri = downloadUri; downloadSuccessEventArgs.CurrentLength = currentLength; downloadSuccessEventArgs.UserData = userData; return downloadSuccessEventArgs; } /// /// 清理下载成功事件。 /// public override void Clear() { SerialId = 0; DownloadPath = null; DownloadUri = null; CurrentLength = 0L; UserData = null; } } }