Exemple #1
0
        public TemplatePage(TemplatePagesContext context, IVirtualFile file, PageFormat format = null)
        {
            Context = context ?? throw new ArgumentNullException(nameof(context));
            File    = file ?? throw new ArgumentNullException(nameof(file));

            Format = format ?? Context.GetFormat(File.Extension);
            if (Format == null)
            {
                throw new ArgumentException($"File with extension '{File.Extension}' is not a registered PageFormat in Context.PageFormats", nameof(file));
            }
        }
 public TemplatePage(TemplatePagesContext feature, IVirtualFile file)
 {
     this.Context = feature ?? throw new ArgumentNullException(nameof(feature));
     File         = file ?? throw new ArgumentNullException(nameof(file));
 }
 public TemplatePages(TemplatePagesContext context) => this.Context = context;