ObjectRequestProcessor
using AngleSharp.Media;
using System.Threading;
using System.Threading.Tasks;
namespace AngleSharp.Io.Processors
{
internal sealed class ObjectRequestProcessor : ResourceRequestProcessor<IObjectInfo>
{
public int Width => base.Resource?.Width ?? 0;
public int Height => base.Resource?.Height ?? 0;
public ObjectRequestProcessor(IBrowsingContext context)
: base(context)
{
}
protected override async Task ProcessResponseAsync(IResponse response)
{
IResourceService<IObjectInfo> service = GetService(response);
if (service != null) {
CancellationToken none = CancellationToken.None;
base.Resource = await service.CreateAsync(response, none).ConfigureAwait(false);
}
}
}
}