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); }
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); }
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); }