68 lines
2.5 KiB
C#

using Consulenza.ReportCommon;
namespace Consulenza.ReportWriter.Business
{
/// <summary>
/// Facade pattern against RendererPDF and ReportEnvironment:
/// It bounds ReportEnvironment and RendererPDF to serve representational members (Y, X, Template Pdf and so on ...)
/// for sections drawing methods.
/// Sealed keyword prevents inheritance and constrains this istance to a primitive instantiation process.
/// </summary>
public sealed class RendererFacade : RendererPDF
{
/// <summary>
/// Constructor that bounds with ReportEnvironment and FrameClassMapperManager.
/// </summary>
/// <param name="environment"></param>
public RendererFacade(ReportEnvironment environment)
: base(environment) { }
}
/// <summary>
/// Facade pattern:
/// Gets ReportEnvironment and DataModel and bounds them to RendererPDF.
/// Sealed prevents inheritance and constrains to a primitive instantiation process:
/// It's impossible to obtain new instantiations of RendererFacade and ReportEnvironment types
/// from current EnvironmentFacade istance.
/// </summary>
public sealed class EnvironmentFacade
{
public Consulenza.DataServices.DatiSeiUnico datiSeiUnico;
private readonly RendererFacade _rendererFacade;
private readonly ReportEnvironment _reportEnvironment;
/// <summary>
/// Get RendererFacade property.
/// </summary>
public RendererFacade RendererFacade { get { return _rendererFacade; } }
/// <summary>
/// Get ReportEnvironment property
/// </summary>
public ReportEnvironment ReportEnvironment { get { return _reportEnvironment; } }
/// <summary>
/// Constructor: bounds ReportEnvironment and DataModel to serve internal RendererFacade, ReportEnvironment and FrameClassMapperManager istances.
/// </summary>
/// <param name="environment"></param>
public EnvironmentFacade(ReportEnvironment environment)
{
_rendererFacade = new RendererFacade(environment);
_reportEnvironment = environment;
}
}
/// <summary>
/// Classe che espone alla RendererPDF le proprietà del Chapter.
/// </summary>
public sealed class ChapterFacade
{
/// <summary>
/// Bool che indica se il capitolo deve essere ripetuto in tutte le pagine quando c'è un salto pagina.
/// </summary>
public bool RepeatOnEachPage { get; set; }
}
}