ObjectRequestProcessor
using AngleSharp.Dom;
using AngleSharp.Services;
using AngleSharp.Services.Media;
using System.Threading;
using System.Threading.Tasks;
namespace AngleSharp.Network.RequestProcessors
{
internal class ObjectRequestProcessor : ResourceRequestProcessor<IObjectInfo>
{
public int Width {
get {
if (base.Resource == null)
return 0;
return base.Resource.Width;
}
}
public int Height {
get {
if (base.Resource == null)
return 0;
return base.Resource.Height;
}
}
private ObjectRequestProcessor(IConfiguration options, IResourceLoader loader)
: base(options, loader)
{
}
internal static ObjectRequestProcessor Create(Element element)
{
Document owner = element.Owner;
IConfiguration options = owner.Options;
IResourceLoader loader = owner.Loader;
if (options == null || loader == null)
return null;
return new ObjectRequestProcessor(options, loader);
}
protected override async Task ProcessResponseAsync(IResponse response)
{
IResourceService<IObjectInfo> service = GetService(response);
if (service != null) {
CancellationToken none = CancellationToken.None;
IObjectInfo objectInfo2 = Resource = await service.CreateAsync(response, none).ConfigureAwait(false);
}
}
}
}