Beispiel #1
0
        /// <summary>
        /// Converter for <see cref="KnownVerticalAlignment"/> enumeration type to <see cref="ExcelVerticalAlignment"/>.
        /// </summary>
        /// <param name="alignment">The alignment.</param>
        /// <returns>
        /// A <see cref="ExcelVerticalAlignment"/> value.
        /// </returns>
        private static ExcelVerticalAlignment ToEppVerticalAlignment(this KnownVerticalAlignment alignment)
        {
            switch (alignment)
            {
            case KnownVerticalAlignment.Bottom:
                return(ExcelVerticalAlignment.Bottom);

            case KnownVerticalAlignment.Top:
                return(ExcelVerticalAlignment.Top);

            default:
                return(ExcelVerticalAlignment.Center);
            }
        }
Beispiel #2
0
        /// <summary>
        /// Converts one of the enumeration values <see cref="KnownVerticalAlignment"/> to the proper vertical alignment value for <b>iTextSharp</b>.
        /// </summary>
        /// <param name="verticalAlignment">Vertical alignment.</param>
        /// <returns>
        /// A <see cref="int"/> value that represents the vertical alignment.
        /// </returns>
        public static int ToVerticalTableAlignment(this KnownVerticalAlignment verticalAlignment)
        {
            switch (verticalAlignment)
            {
            case KnownVerticalAlignment.Bottom:
                return(Element.ALIGN_BOTTOM);

            case KnownVerticalAlignment.Center:
                return(Element.ALIGN_MIDDLE);

            default:
            case KnownVerticalAlignment.Top:
                return(Element.ALIGN_TOP);
            }
        }
        /// <summary>
        /// Converter for <see cref="T:iTin.Export.Model.KnownVerticalAlignment"/> enumeration type to <see cref="T:Novacode.VerticalAlignment"/>.
        /// </summary>
        /// <param name="alignment">The alignment.</param>
        /// <returns>
        /// A <see cref="T:Novacode.VerticalAlignment" /> value.
        /// </returns>
        private static VerticalAlignment ToDocxVerticalAlignment(this KnownVerticalAlignment alignment)
        {
            var align = VerticalAlignment.Center;

            switch (alignment)
            {
            case KnownVerticalAlignment.Bottom:
                align = VerticalAlignment.Bottom;
                break;

            case KnownVerticalAlignment.Top:
                align = VerticalAlignment.Top;
                break;
            }

            return(align);
        }
Beispiel #4
0
        /// <summary>
        /// Converts the enumerated type <see cref="KnownVerticalAlignment"/> to the appropriate value for the specified alignment.
        /// </summary>
        /// <param name="alignment">Alignment to convert.</param>
        /// <returns>
        /// A <see cref="int"/> value that represents appropriate the value for the specified alignment.
        /// </returns>
        private static int ToElementVerticalAlignment(this KnownVerticalAlignment alignment)
        {
            int pdfAlignment = Element.ALIGN_MIDDLE;

            switch (alignment)
            {
            case KnownVerticalAlignment.Bottom:
                pdfAlignment = Element.ALIGN_BOTTOM;
                break;

            case KnownVerticalAlignment.Top:
                pdfAlignment = Element.ALIGN_TOP;
                break;
            }

            return(pdfAlignment);
        }