//------------------------------------------------------------ // Game Framework // Copyright © 2013-2021 Jiang Yin. All rights reserved. // Homepage: https://gameframework.cn/ // Feedback: mailto:ellan@gameframework.cn //------------------------------------------------------------ using Axibug.Event; namespace Axibug.Runtime { /// /// Web 请求开始事件。 /// public sealed class WebRequestStartEventArgs : LogicEventArgs { /// /// Web 请求开始事件编号。 /// public static readonly int EventId = typeof(WebRequestStartEventArgs).GetHashCode(); /// /// 初始化 Web 请求开始事件的新实例。 /// public WebRequestStartEventArgs() { SerialId = 0; WebRequestUri = null; UserData = null; } /// /// 获取 Web 请求开始事件编号。 /// public override int Id { get { return EventId; } } /// /// 获取 Web 请求任务的序列编号。 /// public int SerialId { get; private set; } /// /// 获取 Web 请求地址。 /// public string WebRequestUri { get; private set; } /// /// 获取用户自定义数据。 /// public object UserData { get; private set; } /// /// 创建 Web 请求开始事件。 /// /// 内部事件。 /// 创建的 Web 请求开始事件。 public static WebRequestStartEventArgs Create(Axibug.WebRequest.WebRequestStartEventArgs e) { WWWFormInfo wwwFormInfo = (WWWFormInfo)e.UserData; WebRequestStartEventArgs webRequestStartEventArgs = ReferencePool.Acquire(); webRequestStartEventArgs.SerialId = e.SerialId; webRequestStartEventArgs.WebRequestUri = e.WebRequestUri; webRequestStartEventArgs.UserData = wwwFormInfo.UserData; return webRequestStartEventArgs; } /// /// 清理 Web 请求开始事件。 /// public override void Clear() { SerialId = 0; WebRequestUri = null; UserData = null; } } }