86 lines
2.3 KiB
C#
86 lines
2.3 KiB
C#
|
using Axibug.Event;
|
|||
|
|
|||
|
namespace Axibug.Runtime
|
|||
|
{
|
|||
|
public class WebRequestSuccessEventArgs : LogicEventArgs
|
|||
|
{
|
|||
|
private byte[] m_WebResponseBytes = null;
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// Web <20><><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD><C9B9>¼<EFBFBD><C2BC><EFBFBD><EFBFBD>š<EFBFBD>
|
|||
|
/// </summary>
|
|||
|
public static readonly int EventId = typeof(WebRequestSuccessEventArgs).GetHashCode();
|
|||
|
/// <summary>
|
|||
|
/// <20><>ȡ Web <20><><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD><C9B9>¼<EFBFBD><C2BC><EFBFBD><EFBFBD>š<EFBFBD>
|
|||
|
/// </summary>
|
|||
|
public override int Id
|
|||
|
{
|
|||
|
get
|
|||
|
{
|
|||
|
return EventId;
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// <20><>ȡ Web <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD><D0B1>š<EFBFBD>
|
|||
|
/// </summary>
|
|||
|
public int SerialId
|
|||
|
{
|
|||
|
get;
|
|||
|
private set;
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// <20><>ȡ Web <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7>
|
|||
|
/// </summary>
|
|||
|
public string WebRequestUri
|
|||
|
{
|
|||
|
get;
|
|||
|
private set;
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// <20><>ȡ<EFBFBD>û<EFBFBD><C3BB>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݡ<EFBFBD>
|
|||
|
/// </summary>
|
|||
|
public object UserData
|
|||
|
{
|
|||
|
get;
|
|||
|
private set;
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// <20><>ȡ Web <20><>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
/// </summary>
|
|||
|
/// <returns>Web <20><>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD></returns>
|
|||
|
public byte[] GetWebResponseBytes()
|
|||
|
{
|
|||
|
return m_WebResponseBytes;
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// <20><><EFBFBD><EFBFBD> Web <20><><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD><C9B9>¼<EFBFBD><C2BC><EFBFBD>
|
|||
|
/// </summary>
|
|||
|
/// <param name="e"><3E>ڲ<EFBFBD><DAB2>¼<EFBFBD><C2BC><EFBFBD></param>
|
|||
|
/// <returns><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Web <20><><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD><C9B9>¼<EFBFBD><C2BC><EFBFBD></returns>
|
|||
|
public static WebRequestSuccessEventArgs Create(WebRequest.WebRequestSuccessEventArgs e)
|
|||
|
{
|
|||
|
WWWFormInfo wwwFormInfo = (WWWFormInfo)e.UserData;
|
|||
|
WebRequestSuccessEventArgs webRequestSuccessEventArgs = ReferencePool.Acquire<WebRequestSuccessEventArgs>();
|
|||
|
webRequestSuccessEventArgs.SerialId = e.SerialId;
|
|||
|
webRequestSuccessEventArgs.WebRequestUri = e.WebRequestUri;
|
|||
|
webRequestSuccessEventArgs.m_WebResponseBytes = e.GetWebResponseBytes();
|
|||
|
webRequestSuccessEventArgs.UserData = wwwFormInfo.UserData;
|
|||
|
ReferencePool.Release(wwwFormInfo);
|
|||
|
return webRequestSuccessEventArgs;
|
|||
|
}
|
|||
|
|
|||
|
public override void Clear()
|
|||
|
{
|
|||
|
SerialId = 0;
|
|||
|
WebRequestUri = null;
|
|||
|
UserData = null;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
|