예제 #1
0
        private void addPieces <P, S>(
            StyleMap styleMap,
            ParagraphType type,
            IList <P> paragraphList
            )
            where P : Paragraph <S>, new()
            where S : struct
        {
            foreach (var style in styleMap)
            {
                var missingSizes = style.Value
                                   .Where(c => c.Value == 0)
                                   .ToList();

                if (missingSizes.Any())
                {
                    addParagraph(
                        type,
                        paragraphList,
                        (S)style.Key,
                        $"{type}_{style.Key}"
                        );
                }

                foreach (var @char in missingSizes)
                {
                    addParagraph(
                        type,
                        paragraphList,
                        (S)style.Key,
                        "".PadLeft(20, @char.Key)
                        );
                }
            }
        }
예제 #2
0
        public static StyleMap New <T>(ParagraphType type)
        {
            var map = new StyleMap();

            map.fill <T>(type);
            return(map);
        }