Пример #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RenderingBlock"/> class with a name, a source,
 /// a collection of blocks, and data and fragment json.
 /// </summary>
 /// <param name="name">The name of the block.</param>
 /// <param name="source">The block source.</param>
 /// <param name="blocks">The block inner blocks.</param>
 /// <param name="data">The block data dictionary (using case-insensitive keys).</param>
 /// <param name="fragment">The block content fragment.</param>
 /// <param name="cache">The cache parameters.</param>
 /// <remarks>The block data can be null.</remarks>
 public RenderingBlock(string name, string source, IEnumerable <RenderingBlock> blocks,
                       IDictionary <string, object> data, IPublishedContent fragment, CacheProfile cache)
 {
     Name     = name;
     Source   = source;
     Blocks   = new RenderingBlockCollection(blocks);
     Data     = data;
     Fragment = fragment;
     Cache    = cache;
 }
Пример #2
0
        void CopyFromProfile(CacheProfile cache)
        {
            // do not copy profile!
            Duration      = cache.Duration;
            Mode          = cache.Mode;
            ByPage        = cache.ByPage;
            ByMember      = cache.ByMember;
            ByConst       = cache.ByConst;
            ByQueryString = cache.ByQueryString;
            ByProperty    = cache.ByProperty;
            ByCustom      = cache.ByCustom;

            ModeFunc   = cache.ModeFunc;
            CustomFunc = cache.CustomFunc;
        }
Пример #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RenderingStructure"/> class with a source and a collection of blocks.
 /// </summary>
 /// <param name="source">The structure source.</param>
 /// <param name="blocks">The structure blocks.</param>
 /// <param name="data">The structure data dictionary (using case-insensitive keys).</param>
 /// <param name="cache">The cache paramters.</param>
 /// <remarks>The structure data can be null.</remarks>
 public RenderingStructure(string source, IEnumerable <RenderingBlock> blocks, IDictionary <string, object> data, CacheProfile cache)
     : base(null, source, blocks, data, null, cache)
 {
     //Source = source;
     //Blocks = new RenderingBlockCollection(blocks);
 }