コード例 #1
0
        internal void FromAlignment(Alignment align)
        {
            this.SetAllNull();

            if (align.Horizontal != null)
            {
                this.Horizontal = align.Horizontal.Value;
            }
            if (align.Vertical != null)
            {
                this.Vertical = align.Vertical.Value;
            }

            if (align.TextRotation != null && align.TextRotation.Value <= 180)
            {
                this.TextRotation = this.TextRotationToIntuitiveValue(align.TextRotation.Value);
            }

            if (align.WrapText != null)
            {
                this.WrapText = align.WrapText.Value;
            }
            if (align.Indent != null)
            {
                this.Indent = align.Indent.Value;
            }
            if (align.RelativeIndent != null)
            {
                this.RelativeIndent = align.RelativeIndent.Value;
            }
            if (align.JustifyLastLine != null)
            {
                this.JustifyLastLine = align.JustifyLastLine.Value;
            }
            if (align.ShrinkToFit != null)
            {
                this.ShrinkToFit = align.ShrinkToFit.Value;
            }

            if (align.ReadingOrder != null)
            {
                switch (align.ReadingOrder.Value)
                {
                case (uint)SLAlignmentReadingOrderValues.ContextDependent:
                    this.ReadingOrder = SLAlignmentReadingOrderValues.ContextDependent;
                    break;

                case (uint)SLAlignmentReadingOrderValues.LeftToRight:
                    this.ReadingOrder = SLAlignmentReadingOrderValues.LeftToRight;
                    break;

                case (uint)SLAlignmentReadingOrderValues.RightToLeft:
                    this.ReadingOrder = SLAlignmentReadingOrderValues.RightToLeft;
                    break;
                }
            }
        }
コード例 #2
0
        internal void FromHash(string Hash)
        {
            SetAllNull();

            var sa = Hash.Split(new[] { SLConstants.XmlAlignmentAttributeSeparator }, StringSplitOptions.None);

            if (sa.Length >= 9)
            {
                if (!sa[0].Equals("null"))
                {
                    Horizontal = (HorizontalAlignmentValues)Enum.Parse(typeof(HorizontalAlignmentValues), sa[0]);
                }

                if (!sa[1].Equals("null"))
                {
                    Vertical = (VerticalAlignmentValues)Enum.Parse(typeof(VerticalAlignmentValues), sa[1]);
                }

                if (!sa[2].Equals("null"))
                {
                    TextRotation = int.Parse(sa[2]);
                }

                if (!sa[3].Equals("null"))
                {
                    WrapText = bool.Parse(sa[3]);
                }

                if (!sa[4].Equals("null"))
                {
                    Indent = uint.Parse(sa[4]);
                }

                if (!sa[5].Equals("null"))
                {
                    RelativeIndent = int.Parse(sa[5]);
                }

                if (!sa[6].Equals("null"))
                {
                    JustifyLastLine = bool.Parse(sa[6]);
                }

                if (!sa[7].Equals("null"))
                {
                    ShrinkToFit = bool.Parse(sa[7]);
                }

                if (!sa[8].Equals("null"))
                {
                    ReadingOrder =
                        (SLAlignmentReadingOrderValues)Enum.Parse(typeof(SLAlignmentReadingOrderValues), sa[8]);
                }
            }
        }
コード例 #3
0
 private void SetAllNull()
 {
     this.vHorizontal     = HorizontalAlignmentValues.General;
     this.HasHorizontal   = false;
     this.vVertical       = VerticalAlignmentValues.Bottom;
     this.HasVertical     = false;
     this.TextRotation    = null;
     this.WrapText        = null;
     this.Indent          = null;
     this.RelativeIndent  = null;
     this.JustifyLastLine = null;
     this.ShrinkToFit     = null;
     this.vReadingOrder   = SLAlignmentReadingOrderValues.LeftToRight;
     this.HasReadingOrder = false;
 }
コード例 #4
0
 private void SetAllNull()
 {
     vHorizontal     = HorizontalAlignmentValues.General;
     HasHorizontal   = false;
     vVertical       = VerticalAlignmentValues.Bottom;
     HasVertical     = false;
     TextRotation    = null;
     WrapText        = null;
     Indent          = null;
     RelativeIndent  = null;
     JustifyLastLine = null;
     ShrinkToFit     = null;
     vReadingOrder   = SLAlignmentReadingOrderValues.LeftToRight;
     HasReadingOrder = false;
 }
コード例 #5
0
ファイル: SLAlignment.cs プロジェクト: mousetwentytwo/test
        internal void FromHash(string Hash)
        {
            this.SetAllNull();

            string[] sa = Hash.Split(new string[] { SLConstants.XmlAlignmentAttributeSeparator }, StringSplitOptions.None);

            if (sa.Length >= 9)
            {
                if (!sa[0].Equals("null")) this.Horizontal = (HorizontalAlignmentValues)Enum.Parse(typeof(HorizontalAlignmentValues), sa[0]);

                if (!sa[1].Equals("null")) this.Vertical = (VerticalAlignmentValues)Enum.Parse(typeof(VerticalAlignmentValues), sa[1]);

                if (!sa[2].Equals("null")) this.TextRotation = int.Parse(sa[2]);

                if (!sa[3].Equals("null")) this.WrapText = bool.Parse(sa[3]);

                if (!sa[4].Equals("null")) this.Indent = uint.Parse(sa[4]);

                if (!sa[5].Equals("null")) this.RelativeIndent = int.Parse(sa[5]);

                if (!sa[6].Equals("null")) this.JustifyLastLine = bool.Parse(sa[6]);

                if (!sa[7].Equals("null")) this.ShrinkToFit = bool.Parse(sa[7]);

                if (!sa[8].Equals("null")) this.ReadingOrder = (SLAlignmentReadingOrderValues)Enum.Parse(typeof(SLAlignmentReadingOrderValues), sa[8]);
            }
        }
コード例 #6
0
ファイル: SLAlignment.cs プロジェクト: mousetwentytwo/test
        internal void FromAlignment(Alignment align)
        {
            this.SetAllNull();

            if (align.Horizontal != null) this.Horizontal = align.Horizontal.Value;
            if (align.Vertical != null) this.Vertical = align.Vertical.Value;

            if (align.TextRotation != null && align.TextRotation.Value <= 180)
            {
                this.TextRotation = this.TextRotationToIntuitiveValue(align.TextRotation.Value);
            }

            if (align.WrapText != null) this.WrapText = align.WrapText.Value;
            if (align.Indent != null) this.Indent = align.Indent.Value;
            if (align.RelativeIndent != null) this.RelativeIndent = align.RelativeIndent.Value;
            if (align.JustifyLastLine != null) this.JustifyLastLine = align.JustifyLastLine.Value;
            if (align.ShrinkToFit != null) this.ShrinkToFit = align.ShrinkToFit.Value;

            if (align.ReadingOrder != null)
            {
                switch (align.ReadingOrder.Value)
                {
                    case (uint)SLAlignmentReadingOrderValues.ContextDependent:
                        this.ReadingOrder = SLAlignmentReadingOrderValues.ContextDependent;
                        break;
                    case (uint)SLAlignmentReadingOrderValues.LeftToRight:
                        this.ReadingOrder = SLAlignmentReadingOrderValues.LeftToRight;
                        break;
                    case (uint)SLAlignmentReadingOrderValues.RightToLeft:
                        this.ReadingOrder = SLAlignmentReadingOrderValues.RightToLeft;
                        break;
                }
            }
        }
コード例 #7
0
ファイル: SLAlignment.cs プロジェクト: mousetwentytwo/test
 private void SetAllNull()
 {
     this.vHorizontal = HorizontalAlignmentValues.General;
     this.HasHorizontal = false;
     this.vVertical = VerticalAlignmentValues.Bottom;
     this.HasVertical = false;
     this.TextRotation = null;
     this.WrapText = null;
     this.Indent = null;
     this.RelativeIndent = null;
     this.JustifyLastLine = null;
     this.ShrinkToFit = null;
     this.vReadingOrder = SLAlignmentReadingOrderValues.LeftToRight;
     this.HasReadingOrder = false;
 }