Exemple #1
0
            private static XDesign_Block XDesign_Block(BlockComponent blockComponent, int size)
            {
                if (blockComponent == null)
                {
                    throw new ArgumentNullException(nameof(blockComponent));
                }

                var idxLastSlash = blockComponent.Name.LastIndexOf('/');
                var group        = idxLastSlash != -1
                    ? blockComponent.Name.Substring(0, idxLastSlash)
                    : "Default";

                var id = blockComponent.Name.Replace(" ", "");

                var result = new XDesign_Block()
                {
                    id            = id,
                    blockCategory = blockComponent.Category,
                    blockGroup    = group,
                    blockName     = blockComponent.Name,
                    fabricStyles  = XDesign_FabricStyles(blockComponent.FabricStyles),
                    preview       = XDesign_BlockPreview(blockComponent, size)
                };

                return(result);
            }
Exemple #2
0
            public static XDesign_Block XDesign_Block(MDesign_Block mBlock)
            {
                var result = new XDesign_Block()
                {
                    id            = mBlock.Id,
                    blockCategory = mBlock.Category,
                    blockGroup    = mBlock.Group,
                    blockName     = mBlock.BlockName,
                    fabricStyles  = XDesign_FabricStyles(mBlock.FabricStyles),
                    preview       = XDesign_BlockPreview(mBlock.Preview)
                };

                return(result);
            }