Esempio n. 1
0
 public static StringAlignments FromContentAlignment(ContentAlignment ca)
 {
     Int32 lNum = (Int32)Math.Log((Double)ca, 2);
     StringAlignments sa = new StringAlignments();
     sa.LineAlignment = (StringAlignment)(lNum / 4);
     sa.Alignment = (StringAlignment)(lNum % 4);
     return sa;
 }
        public static StringAlignments FromContentAlignment(ContentAlignment ca)
        {
            Int32            lNum = (Int32)Math.Log((Double)ca, 2);
            StringAlignments sa   = new StringAlignments();

            sa.LineAlignment = (StringAlignment)(lNum / 4);
            sa.Alignment     = (StringAlignment)(lNum % 4);
            return(sa);
        }
Esempio n. 3
0
        public static StringAlignments FromHorizontalAlignment(HorizontalAlignment ha)
        {
            StringAlignments sa = new StringAlignments();
            sa.LineAlignment = StringAlignment.Center;
            switch(ha)
            {
                case HorizontalAlignment.Center:
                    sa.Alignment = StringAlignment.Center;
                    break;
                case HorizontalAlignment.Left:
                    sa.Alignment = StringAlignment.Near;
                    break;
                case HorizontalAlignment.Right:
                    sa.Alignment = StringAlignment.Far;
                    break;
            }

            return sa;
        }
        public static StringAlignments FromHorizontalAlignment(HorizontalAlignment ha)
        {
            StringAlignments sa = new StringAlignments();

            sa.LineAlignment = StringAlignment.Center;
            switch (ha)
            {
            case HorizontalAlignment.Center:
                sa.Alignment = StringAlignment.Center;
                break;

            case HorizontalAlignment.Left:
                sa.Alignment = StringAlignment.Near;
                break;

            case HorizontalAlignment.Right:
                sa.Alignment = StringAlignment.Far;
                break;
            }

            return(sa);
        }