Ejemplo n.º 1
0
        private void ConvertToAggtMeta(AggtBlocks aggt, ClientAggtMeta meta, string childPropertyName = null)
        {
            var mainBlock = aggt.MainBlock;

            meta.mainBlock = ConvertToClientMeta(mainBlock.ViewMeta.AsWebView(), mainBlock.BlockType == BlockType.Detail);
            if (mainBlock is ChildBlock)
            {
                meta.mainBlock.label = (mainBlock as ChildBlock).Label;
            }
            meta.childProperty = childPropertyName;
            meta.layoutClass   = aggt.Layout.Class;

            //surrounders
            foreach (var surAggt in aggt.Surrounders)
            {
                var surBlock     = surAggt.MainBlock as SurrounderBlock;
                var surroundMeta = new SurrounderMeta
                {
                    surrounderType = surBlock.SurrounderType
                };
                ConvertToAggtMeta(surAggt, surroundMeta);
                meta.surrounders.Add(surroundMeta);
            }

            //children
            foreach (var childAggt in aggt.Children)
            {
                var childBlock = childAggt.MainBlock as ChildBlock;
                var child      = ConvertToAggtMeta(childAggt, childBlock.ChildrenPropertyName);
                meta.children.Add(child);
            }
        }
Ejemplo n.º 2
0
        private void ConvertToAggtMeta(AggtBlocks aggt, ClientAggtMeta meta, string childPropertyName = null)
        {
            var mainBlock = aggt.MainBlock;
            meta.mainBlock = ConvertToClientMeta(mainBlock.ViewMeta.AsWebView(), mainBlock.BlockType == BlockType.Detail);
            if (mainBlock is ChildBlock)
            {
                meta.mainBlock.label = (mainBlock as ChildBlock).Label;
            }
            meta.childProperty = childPropertyName;
            meta.layoutClass = aggt.Layout.Class;

            //surrounders
            foreach (var surAggt in aggt.Surrounders)
            {
                var surBlock = surAggt.MainBlock as SurrounderBlock;
                var surroundMeta = new SurrounderMeta
                {
                    surrounderType = surBlock.SurrounderType
                };
                ConvertToAggtMeta(surAggt, surroundMeta);
                meta.surrounders.Add(surroundMeta);
            }

            //children
            foreach (var childAggt in aggt.Children)
            {
                var childBlock = childAggt.MainBlock as ChildBlock;
                var child = ConvertToAggtMeta(childAggt, childBlock.ChildrenPropertyName);
                meta.children.Add(child);
            }
        }