Exemple #1
0
 public static String getCodeName(appendRole __role, appendType __type, styleTheme theme)
 {
     return(__role.ToString() + "_" + __type.ToString() + "_" + theme.getCodeName());
 }
Exemple #2
0
        internal void processRole(appendRole __role, appendType __type, styleTheme theme)
        {
            role = __role;
            type = __type;

            Int32 sizeKWidth  = 8;
            Int32 sizeKHeight = 1;

            themeCodeName = theme.getCodeName();

            var sizeEnum = imbStringMarkdownExtensions.getTextSizeEnum(__type);
            var size     = theme.fontSize.headingSizes[sizeEnum.ToInt32()];

            fourSideSetting margin  = theme.fontSize.headingMargins[sizeEnum.ToInt32()];
            fourSideSetting padding = theme.fontSize.headingPaddings[sizeEnum.ToInt32()];

            sizeAndBorder.apply(margin, styleFourSideParameter.margin);
            sizeAndBorder.apply(padding, styleFourSideParameter.padding);

            String roleName = role.ToString();

            aligment = textCursorZoneCorner.Left;

            if (roleName.StartsWith("merged"))
            {
                doWrapText     = true;
                doCallForMerge = true;
            }

            if (roleName.StartsWith("section"))
            {
                doWrapText = true;
            }

            if (roleName.EndsWith("Head"))
            {
                aligment = textCursorZoneCorner.center;
                sizeAndBorder.bottom.type = styleBorderType.Thin;
            }

            if (roleName.EndsWith("Foot"))
            {
                aligment = textCursorZoneCorner.Left;
                sizeAndBorder.top.type = styleBorderType.Thin;
            }

            switch (role)
            {
            case appendRole.none:
                break;

            case appendRole.mergedHead:

                break;

            case appendRole.mergedContent:
                break;

            case appendRole.mergedFoot:

                break;

            case appendRole.sectionHead:

                break;

            case appendRole.sectionContent:
                break;

            case appendRole.sectionFoot:

                break;

            case appendRole.majorHeading:
                break;

            case appendRole.minorHeading:
                break;

            case appendRole.paragraph:
                break;

            case appendRole.remark:
                break;

            case appendRole.tableHead:
                sizeAndBorder.top.type = styleBorderType.Double;
                doWrapText             = true;
                doCallForMerge         = true;
                break;

            case appendRole.tableColumnHead:
                doWrapText = true;
                break;

            case appendRole.tableColumnFoot:
                sizeAndBorder.top.type = styleBorderType.Dotted;
                break;

            case appendRole.tableCellValue:
                break;

            case appendRole.tableCellAnnotation:
                sizeAndBorder.top.type    = styleBorderType.Dotted;
                sizeAndBorder.bottom.type = styleBorderType.Dotted;
                break;

            case appendRole.tableCellNovalue:

                break;

            case appendRole.tableBetween:
                sizeAndBorder.top.type    = styleBorderType.Dotted;
                sizeAndBorder.bottom.type = styleBorderType.Dotted;
                break;

            case appendRole.tableFoot:
                sizeAndBorder.bottom.type = styleBorderType.Double;
                break;

            case appendRole.i_container:
                break;

            case appendRole.i_margin:
                sizeKHeight = 1;
                sizeKWidth  = 1;
                break;

            case appendRole.i_line:
                break;

            default:
                break;
            }

            minSize         = new styleSize(size * sizeKWidth, size * sizeKHeight);
            minSize.width  += sizeAndBorder.left.padding + sizeAndBorder.right.padding;
            minSize.height += sizeAndBorder.top.padding + sizeAndBorder.bottom.padding;
        }