コード例 #1
0
        /// <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;
        }
コード例 #2
0
 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);
 }
コード例 #3
0
ファイル: Model.cs プロジェクト: csf-dev/ZPT-Sharp
        /// <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;
        }