/// <summary> /// Initializes a new instance of the <see cref="CSF.Zpt.Tales.BuiltinContextsContainer"/> class. /// </summary> /// <param name="options">Options.</param> /// <param name="repeat">Repeat.</param> /// <param name="attrs">Attrs.</param> /// <param name="templateFileFactory">A template-file factory.</param> /// <param name="model">The model being rendered.</param> public BuiltinContextsContainer(NamedObjectWrapper options, RepetitionMetadataCollectionWrapper repeat, Lazy<OriginalAttributeValuesCollection> attrs, ITemplateFileFactory templateFileFactory, object model = null) { if(options == null) { throw new ArgumentNullException(nameof(options)); } if(repeat == null) { throw new ArgumentNullException(nameof(repeat)); } if(attrs == null) { throw new ArgumentNullException(nameof(attrs)); } _nothing = null; _default = ZptConstants.CancellationToken; _options = options; _repeat = repeat; _attrs = attrs; _model = model; _templateFileFactory = templateFileFactory; }
public MvcContextsContainer(NamedObjectWrapper options, RepetitionMetadataCollectionWrapper repeat, Lazy<OriginalAttributeValuesCollection> attrs, ViewContext viewContext, ITemplateFileFactory templateFileFactory = null) : base(options, repeat, attrs, templateFileFactory, viewContext?.ViewData?.Model) { _viewContext = viewContext?? new ViewContext(); _applicationDictionary = GetApplicationDictionary(viewContext); }
/// <summary> /// Gets the contextualised repetition summaries. /// </summary> /// <returns>The repetition summaries.</returns> protected virtual RepetitionMetadataCollectionWrapper GetRepetitionSummaries() { if(_cachedRepetitionSummaries == null) { var allRepetitions = RecursivelyGetAllRepetitions(); _cachedRepetitionSummaries = new RepetitionMetadataCollectionWrapper(allRepetitions); } return _cachedRepetitionSummaries; }