コード例 #1
0
 public static xdr.Shape SetVerticalTextAlignment(this xdr.Shape shape, a.TextAnchoringTypeValues alignment)
 {
     if (shape == null)
     {
         return(null);
     }
     if (shape.TextBody == null)
     {
         shape.TextBody = new xdr.TextBody().InitDefault();
     }
     shape.TextBody.SetVerticalAlignment(alignment);
     return(shape);
 }
        public static xdr.TextBody SetVerticalAlignment(this xdr.TextBody textBody, a.TextAnchoringTypeValues alignment)
        {
            var textBodyProps = textBody.GetFirstChild <a.BodyProperties>();

            if (textBodyProps == null)
            {
                textBodyProps = new a.BodyProperties()
                {
                    VerticalOverflow   = a.TextVerticalOverflowValues.Clip,
                    HorizontalOverflow = a.TextHorizontalOverflowValues.Clip
                };
                textBody.PrependChild(textBodyProps);
            }
            textBodyProps.Anchor = alignment;
            return(textBody);
        }