using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Inet.Viewer.Data
{
///
/// An implementation of IPageReceiver which forwards any error during page receiving to
/// a delegate. Actual page data is ignored.
///
internal class FailurePageReceiver : IPageReceiver
{
private Action action;
///
/// Creates the instance with the specified delegate.
///
/// the delegate which receives errors
internal FailurePageReceiver(Action action)
{
this.action = action;
}
///
public bool WriteReportInfo(Data.ReportInfo info, Data.PageLoader loader)
{
return true;
}
///
public bool WritePageInfo(Data.PageInfo info, Data.PageLoader loader)
{
return true;
}
///
public System.Drawing.Font GetEmbeddedFont(int fontID, int fontRevision)
{
return null;
}
///
public void PageLoadFailure(Exception exception)
{
action(exception);
}
}
}