Exemple #1
0
 internal FormattedCell(Cell cell, DocumentRenderer documentRenderer, Borders cellBorders, FieldInfos fieldInfos, XUnit xOffset, XUnit yOffset)
 {
   this.cell = cell;
   this.fieldInfos = fieldInfos;
   this.yOffset = yOffset;
   this.xOffset = xOffset;
   this.bordersRenderer = new BordersRenderer(cellBorders, null);
   this.documentRenderer = documentRenderer;
 }
Exemple #2
0
 internal FormattedCell(Cell cell, DocumentRenderer documentRenderer, Borders cellBorders, FieldInfos fieldInfos, XUnit xOffset, XUnit yOffset)
 {
     _cell = cell;
     _fieldInfos = fieldInfos;
     _yOffset = yOffset;
     _xOffset = xOffset;
     _bordersRenderer = new BordersRenderer(cellBorders, null);
     _documentRenderer = documentRenderer;
 }
Exemple #3
0
        /// <summary>
        /// Implements the deep copy of the object.
        /// </summary>
        protected override object DeepCopy()
        {
            Borders borders = (Borders)base.DeepCopy();

            if (borders._top != null)
            {
                borders._top         = borders._top.Clone();
                borders._top._parent = borders;
            }
            if (borders._left != null)
            {
                borders._left         = borders._left.Clone();
                borders._left._parent = borders;
            }
            if (borders._right != null)
            {
                borders._right         = borders._right.Clone();
                borders._right._parent = borders;
            }
            if (borders._bottom != null)
            {
                borders._bottom         = borders._bottom.Clone();
                borders._bottom._parent = borders;
            }
            if (borders._diagonalUp != null)
            {
                borders._diagonalUp         = borders._diagonalUp.Clone();
                borders._diagonalUp._parent = borders;
            }
            if (borders._diagonalDown != null)
            {
                borders._diagonalDown         = borders._diagonalDown.Clone();
                borders._diagonalDown._parent = borders;
            }
            return(borders);
        }
 void RenderDiagonalBorders(Borders mergedBorders, Rectangle innerRect)
 {
   BordersRenderer bordersRenderer = new BordersRenderer(mergedBorders, this.gfx);
   bordersRenderer.RenderDiagonally(BorderType.DiagonalDown, innerRect.X, innerRect.Y, innerRect.Width, innerRect.Height);
   bordersRenderer.RenderDiagonally(BorderType.DiagonalUp, innerRect.X, innerRect.Y, innerRect.Width, innerRect.Height);
 }
Exemple #5
0
        /// <summary>
        /// Converts Borders into DDL.
        /// </summary>
        internal void Serialize(Serializer serializer, Borders refBorders)
        {
            if (_clearAll)
            {
                serializer.WriteLine("Borders = null");
            }

            int pos = serializer.BeginContent("Borders");

            if (!_visible.IsNull && (refBorders == null || refBorders._visible.IsNull || (Visible != refBorders.Visible)))
            {
                serializer.WriteSimpleAttribute("Visible", Visible);
            }

            if (!_style.IsNull && (refBorders == null || (Style != refBorders.Style)))
            {
                serializer.WriteSimpleAttribute("Style", Style);
            }

            if (!_width.IsNull && (refBorders == null || (_width.Value != refBorders._width.Value)))
            {
                serializer.WriteSimpleAttribute("Width", Width);
            }

            if (!_color.IsNull && (refBorders == null || ((Color.Argb != refBorders.Color.Argb))))
            {
                serializer.WriteSimpleAttribute("Color", Color);
            }

            if (!_distanceFromTop.IsNull && (refBorders == null || (DistanceFromTop.Point != refBorders.DistanceFromTop.Point)))
            {
                serializer.WriteSimpleAttribute("DistanceFromTop", DistanceFromTop);
            }

            if (!_distanceFromBottom.IsNull && (refBorders == null || (DistanceFromBottom.Point != refBorders.DistanceFromBottom.Point)))
            {
                serializer.WriteSimpleAttribute("DistanceFromBottom", DistanceFromBottom);
            }

            if (!_distanceFromLeft.IsNull && (refBorders == null || (DistanceFromLeft.Point != refBorders.DistanceFromLeft.Point)))
            {
                serializer.WriteSimpleAttribute("DistanceFromLeft", DistanceFromLeft);
            }

            if (!_distanceFromRight.IsNull && (refBorders == null || (DistanceFromRight.Point != refBorders.DistanceFromRight.Point)))
            {
                serializer.WriteSimpleAttribute("DistanceFromRight", DistanceFromRight);
            }

            if (!IsNull("Top"))
            {
                _top.Serialize(serializer, "Top", null);
            }

            if (!IsNull("Left"))
            {
                _left.Serialize(serializer, "Left", null);
            }

            if (!IsNull("Bottom"))
            {
                _bottom.Serialize(serializer, "Bottom", null);
            }

            if (!IsNull("Right"))
            {
                _right.Serialize(serializer, "Right", null);
            }

            if (!IsNull("DiagonalDown"))
            {
                _diagonalDown.Serialize(serializer, "DiagonalDown", null);
            }

            if (!IsNull("DiagonalUp"))
            {
                _diagonalUp.Serialize(serializer, "DiagonalUp", null);
            }

            serializer.EndContent(pos);
        }
Exemple #6
0
    /// <summary>
    /// Converts Borders into DDL.
    /// </summary>
    internal void Serialize(Serializer serializer, Borders refBorders)
    {
      if (this.clearAll)
        serializer.WriteLine("Borders = null");

      int pos = serializer.BeginContent("Borders");

      if (!this.visible.IsNull && (refBorders == null || refBorders.visible.IsNull || (this.Visible != refBorders.Visible)))
        serializer.WriteSimpleAttribute("Visible", this.Visible);

      if (!this.style.IsNull && (refBorders == null || (this.Style != refBorders.Style)))
        serializer.WriteSimpleAttribute("Style", this.Style);

      if (!this.width.IsNull && (refBorders == null || (this.width.Value != refBorders.width.Value)))
        serializer.WriteSimpleAttribute("Width", this.Width);

      if (!this.color.IsNull && (refBorders == null || ((this.Color.Argb != refBorders.Color.Argb))))
        serializer.WriteSimpleAttribute("Color", this.Color);

      if (!this.distanceFromTop.IsNull && (refBorders == null || (this.DistanceFromTop.Point != refBorders.DistanceFromTop.Point)))
        serializer.WriteSimpleAttribute("DistanceFromTop", this.DistanceFromTop);

      if (!this.distanceFromBottom.IsNull && (refBorders == null || (this.DistanceFromBottom.Point != refBorders.DistanceFromBottom.Point)))
        serializer.WriteSimpleAttribute("DistanceFromBottom", this.DistanceFromBottom);

      if (!this.distanceFromLeft.IsNull && (refBorders == null || (this.DistanceFromLeft.Point != refBorders.DistanceFromLeft.Point)))
        serializer.WriteSimpleAttribute("DistanceFromLeft", this.DistanceFromLeft);

      if (!this.distanceFromRight.IsNull && (refBorders == null || (this.DistanceFromRight.Point != refBorders.DistanceFromRight.Point)))
        serializer.WriteSimpleAttribute("DistanceFromRight", this.DistanceFromRight);

      if (!this.IsNull("Top"))
        this.top.Serialize(serializer, "Top", null);

      if (!this.IsNull("Left"))
        this.left.Serialize(serializer, "Left", null);

      if (!this.IsNull("Bottom"))
        this.bottom.Serialize(serializer, "Bottom", null);

      if (!this.IsNull("Right"))
        this.right.Serialize(serializer, "Right", null);

      if (!this.IsNull("DiagonalDown"))
        this.diagonalDown.Serialize(serializer, "DiagonalDown", null);

      if (!this.IsNull("DiagonalUp"))
        this.diagonalUp.Serialize(serializer, "DiagonalUp", null);

      serializer.EndContent(pos);
    }
 internal BordersRenderer(DocumentObject domObj, RtfDocumentRenderer docRenderer)
     : base(domObj, docRenderer)
 {
     this.borders = domObj as Borders;
 }
Exemple #8
0
 internal BordersRenderer(Borders borders, XGraphics gfx)
 {
     Debug.Assert(borders.Document != null);
     _gfx = gfx;
     _borders = borders;
 }
Exemple #9
0
        /// <summary>
        /// Converts Borders into DDL.
        /// </summary>
        internal void Serialize(Serializer serializer, Borders refBorders)
        {
            if (this.clearAll)
            {
                serializer.WriteLine("Borders = null");
            }

            int pos = serializer.BeginContent("Borders");

            if (!this.visible.IsNull && (refBorders == null || refBorders.visible.IsNull || (this.Visible != refBorders.Visible)))
            {
                serializer.WriteSimpleAttribute("Visible", this.Visible);
            }

            if (!this.style.IsNull && (refBorders == null || (this.Style != refBorders.Style)))
            {
                serializer.WriteSimpleAttribute("Style", this.Style);
            }

            if (!this.width.IsNull && (refBorders == null || (this.width.Value != refBorders.width.Value)))
            {
                serializer.WriteSimpleAttribute("Width", this.Width);
            }

            if (!this.color.IsNull && (refBorders == null || ((this.Color.Argb != refBorders.Color.Argb))))
            {
                serializer.WriteSimpleAttribute("Color", this.Color);
            }

            if (!this.distanceFromTop.IsNull && (refBorders == null || (this.DistanceFromTop.Point != refBorders.DistanceFromTop.Point)))
            {
                serializer.WriteSimpleAttribute("DistanceFromTop", this.DistanceFromTop);
            }

            if (!this.distanceFromBottom.IsNull && (refBorders == null || (this.DistanceFromBottom.Point != refBorders.DistanceFromBottom.Point)))
            {
                serializer.WriteSimpleAttribute("DistanceFromBottom", this.DistanceFromBottom);
            }

            if (!this.distanceFromLeft.IsNull && (refBorders == null || (this.DistanceFromLeft.Point != refBorders.DistanceFromLeft.Point)))
            {
                serializer.WriteSimpleAttribute("DistanceFromLeft", this.DistanceFromLeft);
            }

            if (!this.distanceFromRight.IsNull && (refBorders == null || (this.DistanceFromRight.Point != refBorders.DistanceFromRight.Point)))
            {
                serializer.WriteSimpleAttribute("DistanceFromRight", this.DistanceFromRight);
            }

            if (!this.IsNull("Top"))
            {
                this.top.Serialize(serializer, "Top", null);
            }

            if (!this.IsNull("Left"))
            {
                this.left.Serialize(serializer, "Left", null);
            }

            if (!this.IsNull("Bottom"))
            {
                this.bottom.Serialize(serializer, "Bottom", null);
            }

            if (!this.IsNull("Right"))
            {
                this.right.Serialize(serializer, "Right", null);
            }

            if (!this.IsNull("DiagonalDown"))
            {
                this.diagonalDown.Serialize(serializer, "DiagonalDown", null);
            }

            if (!this.IsNull("DiagonalUp"))
            {
                this.diagonalUp.Serialize(serializer, "DiagonalUp", null);
            }

            serializer.EndContent(pos);
        }
Exemple #10
0
        /// <summary>
        /// Converts Borders into DDL.
        /// </summary>
        internal void Serialize(Serializer serializer, Borders refBorders)
        {
            if (_clearAll)
                serializer.WriteLine("Borders = null");

            int pos = serializer.BeginContent("Borders");

            if (!_visible.IsNull && (refBorders == null || refBorders._visible.IsNull || (Visible != refBorders.Visible)))
                serializer.WriteSimpleAttribute("Visible", Visible);

            if (!_style.IsNull && (refBorders == null || (Style != refBorders.Style)))
                serializer.WriteSimpleAttribute("Style", Style);

            if (!_width.IsNull && (refBorders == null || (_width.Value != refBorders._width.Value)))
                serializer.WriteSimpleAttribute("Width", Width);

            if (!_color.IsNull && (refBorders == null || ((Color.Argb != refBorders.Color.Argb))))
                serializer.WriteSimpleAttribute("Color", Color);

            if (!_distanceFromTop.IsNull && (refBorders == null || (DistanceFromTop.Point != refBorders.DistanceFromTop.Point)))
                serializer.WriteSimpleAttribute("DistanceFromTop", DistanceFromTop);

            if (!_distanceFromBottom.IsNull && (refBorders == null || (DistanceFromBottom.Point != refBorders.DistanceFromBottom.Point)))
                serializer.WriteSimpleAttribute("DistanceFromBottom", DistanceFromBottom);

            if (!_distanceFromLeft.IsNull && (refBorders == null || (DistanceFromLeft.Point != refBorders.DistanceFromLeft.Point)))
                serializer.WriteSimpleAttribute("DistanceFromLeft", DistanceFromLeft);

            if (!_distanceFromRight.IsNull && (refBorders == null || (DistanceFromRight.Point != refBorders.DistanceFromRight.Point)))
                serializer.WriteSimpleAttribute("DistanceFromRight", DistanceFromRight);

            if (!IsNull("Top"))
                _top.Serialize(serializer, "Top", null);

            if (!IsNull("Left"))
                _left.Serialize(serializer, "Left", null);

            if (!IsNull("Bottom"))
                _bottom.Serialize(serializer, "Bottom", null);

            if (!IsNull("Right"))
                _right.Serialize(serializer, "Right", null);

            if (!IsNull("DiagonalDown"))
                _diagonalDown.Serialize(serializer, "DiagonalDown", null);

            if (!IsNull("DiagonalUp"))
                _diagonalUp.Serialize(serializer, "DiagonalUp", null);

            serializer.EndContent(pos);
        }