Example #1
0
        internal DynamicEntityWithList(
            IEntity parent,
            string field,
            IEnumerable <IEntity> entities,
            string[] dimensions,
            int compatibility,
            IBlock block,
            IServiceProvider serviceProvider)
            : base(null, dimensions, compatibility, block, serviceProvider)
        {
            _debugFieldName = field; // remember name in case we do debugging and need to know what list was accessed
            var index = 0;

            DynEntities = entities
                          .Select(e =>
            {
                // we create an Entity with some metadata-decoration, so that toolbars know it's part of a list
                var blockEntity = new EntityInBlock(e, parent.EntityGuid, field, index++);
                return(SubDynEntity(blockEntity));
            })
                          .ToList();
            SetEntity(DynEntities.FirstOrDefault()?.Entity
                      // check empty list - create a dummy Entity so toolbars will know what to do
                      ?? PlaceHolder(parent, field));
        }
Example #2
0
        internal DynamicEntityWithList(IEntity parent, string field, IEnumerable <IEntity> entities, string[] dimensions, int compatibility, IBlock block)
            : base(null, dimensions, compatibility, block)
        {
            var index = 0;

            DynEntities = entities
                          .Select(e =>
            {
                // we create an Entity with some metadata-decoration, so that toolbars know it's part of a list
                var blockEntity = new EntityInBlock(e, parent.EntityGuid, field, index++);
                return(SubDynEntity(blockEntity));
            })
                          .ToList();
            SetEntity(DynEntities.FirstOrDefault()?.Entity
                      // check empty list - create a dummy Entity so toolbars will know what to do
                      ?? EntityInBlock.PlaceHolder(parent, field));
        }