//------------------------------------------------------------
// Game Framework
// Copyright © 2013-2021 loyalsoft. All rights reserved.
// Homepage: http://www.game7000.com/
// Feedback: http://www.game7000.com/
//------------------------------------------------------------
using GameFramework;
using GameFramework.Event;
namespace UnityGameFramework.Runtime
{
///
/// 下载成功事件。
///
public sealed class DownloadSuccessEventArgs : GameEventArgs
{
///
/// 下载成功事件编号。
///
public static readonly int EventId = typeof(DownloadSuccessEventArgs).GetHashCode();
///
/// 初始化下载成功事件的新实例。
///
public DownloadSuccessEventArgs()
{
SerialId = 0;
DownloadPath = null;
DownloadUri = null;
CurrentLength = 0L;
UserData = null;
}
///
/// 获取下载成功事件编号。
///
public override int Id
{
get
{
return EventId;
}
}
///
/// 获取下载任务的序列编号。
///
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(GameFramework.Download.DownloadSuccessEventArgs e)
{
DownloadSuccessEventArgs downloadSuccessEventArgs = ReferencePool.Acquire();
downloadSuccessEventArgs.SerialId = e.SerialId;
downloadSuccessEventArgs.DownloadPath = e.DownloadPath;
downloadSuccessEventArgs.DownloadUri = e.DownloadUri;
downloadSuccessEventArgs.CurrentLength = e.CurrentLength;
downloadSuccessEventArgs.UserData = e.UserData;
return downloadSuccessEventArgs;
}
///
/// 清理下载成功事件。
///
public override void Clear()
{
SerialId = 0;
DownloadPath = null;
DownloadUri = null;
CurrentLength = 0L;
UserData = null;
}
}
}