示例#1
0
        public static a.Paragraph SetTextAlignment(this a.Paragraph paragraph, a.TextAlignmentTypeValues textAlignment)
        {
            var paragraphProperties = paragraph.GetFirstChild <a.ParagraphProperties>();

            if (paragraphProperties == null)
            {
                paragraphProperties = new a.ParagraphProperties();
                paragraph.PrependChild(paragraphProperties);
            }
            paragraphProperties.Alignment = textAlignment;
            return(paragraph);
        }
示例#2
0
 public static xdr.Shape SetHorizontalTextAlignment(this xdr.Shape shape, a.TextAlignmentTypeValues textAlignment)
 {
     if (shape == null)
     {
         return(null);
     }
     if (shape.TextBody == null)
     {
         shape.TextBody = new xdr.TextBody().InitDefault();
     }
     shape.TextBody.SetHorizontalAlignment(textAlignment);
     return(shape);
 }
示例#3
0
        public static xdr.TextBody SetHorizontalAlignment(this xdr.TextBody textBody, a.TextAlignmentTypeValues textAlignment)
        {
            var paragraphs = textBody.Elements <a.Paragraph>();

            foreach (var p in paragraphs)
            {
                p.SetTextAlignment(textAlignment);
            }
            return(textBody);
        }