Exemple #1
0
        /// <summary>
        /// Adds a <c>bodyPr</c> node (Body Properties) to the node of type <c>txPr</c> (Text properties) specified. Not supported in <c>EPPlus</c> library.
        /// </summary>
        /// <param name="textPropertiesNode"><c>txPr</c> node (Text properties).</param>
        /// <param name="orientation">A <see cref="KnownLabelOrientation" /> value from model.</param>
        /// <param name="documentHelper">Target xml document helper.</param>
        /// <remarks>
        /// For more information please see <a href="http://www.schemacentral.com/sc/ooxml/e-a_bodyPr-2.html">http://www.schemacentral.com/sc/ooxml/e-a_bodyPr-2.html</a>
        /// </remarks>
        private static void AddBodyPropertiesNode(this XmlNode textPropertiesNode, LabelOrientation orientation, IXmlHelper documentHelper)
        {
            var rotAttr = documentHelper.CreateAttribute("rot");

            rotAttr.Value = orientation.ToAngle().ToString(CultureInfo.InvariantCulture);

            var vertAttr = documentHelper.CreateAttribute("vert");

            vertAttr.Value = orientation == LabelOrientation.Vertical ? "wordArtVert" : "horz";

            var bodyPropertiesNode = documentHelper.CreateOrDefaultAndAppendElementToNode(textPropertiesNode, "a", "bodyPr");

            bodyPropertiesNode.Attributes.Append(rotAttr);
            bodyPropertiesNode.Attributes.Append(vertAttr);
        }