Esempio n. 1
0
        internal static XLAlignmentKey GenerateKey(IXLAlignment d)
        {
            XLAlignmentKey key;

            if (d == null)
            {
                key = XLAlignmentValue.Default.Key;
            }
            else if (d is XLAlignment)
            {
                key = (d as XLAlignment).Key;
            }
            else
            {
                key = new XLAlignmentKey
                {
                    Horizontal      = d.Horizontal,
                    Vertical        = d.Vertical,
                    Indent          = d.Indent,
                    JustifyLastLine = d.JustifyLastLine,
                    ReadingOrder    = d.ReadingOrder,
                    RelativeIndent  = d.RelativeIndent,
                    ShrinkToFit     = d.ShrinkToFit,
                    TextRotation    = d.TextRotation,
                    WrapText        = d.WrapText
                };
            }
            return(key);
        }
Esempio n. 2
0
        public bool Equals(IXLAlignment other)
        {
            if (other == null)
            {
                return(false);
            }

            var otherA = other as XLAlignment;

            if (otherA == null)
            {
                return(false);
            }

            return
                (_horizontal == otherA._horizontal &&
                 _vertical == otherA._vertical &&
                 _indent == otherA._indent &&
                 _justifyLastLine == otherA._justifyLastLine &&
                 _readingOrder == otherA._readingOrder &&
                 _relativeIndent == otherA._relativeIndent &&
                 _shrinkToFit == otherA._shrinkToFit &&
                 _textRotation == otherA._textRotation &&
                 _wrapText == otherA._wrapText
                );
        }
Esempio n. 3
0
        public bool Equals(IXLAlignment other)
        {
            var otherA = other as XLAlignment;

            if (otherA == null)
            {
                return(false);
            }

            return(Key == otherA.Key);
        }
Esempio n. 4
0
        public XLAlignment(IXLStylized container, IXLAlignment d = null)
        {
            _container = container;
            if (d == null)
            {
                return;
            }

            _horizontal      = d.Horizontal;
            _vertical        = d.Vertical;
            _indent          = d.Indent;
            _justifyLastLine = d.JustifyLastLine;
            _readingOrder    = d.ReadingOrder;
            _relativeIndent  = d.RelativeIndent;
            _shrinkToFit     = d.ShrinkToFit;
            _textRotation    = d.TextRotation;
            _wrapText        = d.WrapText;
        }
        private static bool AlignmentsAreEqual(Alignment alignment, IXLAlignment xlAlignment)
        {
            var a = new XLAlignment();
            if (alignment != null)
            {
                if (alignment.Indent != null)
                    a.Indent = (Int32)alignment.Indent.Value;

                if (alignment.Horizontal != null)
                    a.Horizontal = alignment.Horizontal.Value.ToClosedXml();
                if (alignment.Vertical != null)
                    a.Vertical = alignment.Vertical.Value.ToClosedXml();

                if (alignment.ReadingOrder != null)
                    a.ReadingOrder = alignment.ReadingOrder.Value.ToClosedXml();
                if (alignment.WrapText != null)
                    a.WrapText = alignment.WrapText.Value;
                if (alignment.TextRotation != null)
                    a.TextRotation = (Int32)alignment.TextRotation.Value;
                if (alignment.ShrinkToFit != null)
                    a.ShrinkToFit = alignment.ShrinkToFit.Value;
                if (alignment.RelativeIndent != null)
                    a.RelativeIndent = alignment.RelativeIndent.Value;
                if (alignment.JustifyLastLine != null)
                    a.JustifyLastLine = alignment.JustifyLastLine.Value;
            }
            return a.Equals(xlAlignment);
        }
Esempio n. 6
0
 public XLAlignment(XLStyle style = null, IXLAlignment d = null) : this(style, GenerateKey(d))
 {
 }
Esempio n. 7
0
        public bool Equals(IXLAlignment other)
        {
            if (other == null)
                return false;

            var otherA = other as XLAlignment;
            if (otherA == null)
                return false;

            return
                _horizontal == otherA._horizontal
                && _vertical == otherA._vertical
                && _indent == otherA._indent
                && _justifyLastLine == otherA._justifyLastLine
                && _readingOrder == otherA._readingOrder
                && _relativeIndent == otherA._relativeIndent
                && _shrinkToFit == otherA._shrinkToFit
                && _textRotation == otherA._textRotation
                && _wrapText == otherA._wrapText
                ;
        }
Esempio n. 8
-1
        public XLAlignment(IXLStylized container, IXLAlignment d = null)
        {
            _container = container;
            if (d == null) return;

            _horizontal = d.Horizontal;
            _vertical = d.Vertical;
            _indent = d.Indent;
            _justifyLastLine = d.JustifyLastLine;
            _readingOrder = d.ReadingOrder;
            _relativeIndent = d.RelativeIndent;
            _shrinkToFit = d.ShrinkToFit;
            _textRotation = d.TextRotation;
            _wrapText = d.WrapText;
        }