MigraDoc.Rendering.ParagraphRenderer.InitFormat C# (CSharp) Method

InitFormat() private method

Initializes this instance for formatting.
private InitFormat ( MigraDoc.Rendering.Area area, MigraDoc.Rendering.FormatInfo previousFormatInfo ) : bool
area MigraDoc.Rendering.Area The area for formatting
previousFormatInfo MigraDoc.Rendering.FormatInfo A previous format info.
return bool
    private bool InitFormat(Area area, FormatInfo previousFormatInfo)
    {
      this.phase = Phase.Formatting;

      this.tabOffsets = new ArrayList();

      ParagraphFormatInfo prevParaFormatInfo = (ParagraphFormatInfo)previousFormatInfo;
      if (previousFormatInfo == null || prevParaFormatInfo.LineCount == 0)
      {
        ((ParagraphFormatInfo)this.renderInfo.FormatInfo).isStarting = true;
        ParagraphIterator parIt = new ParagraphIterator(this.paragraph.Elements);
        this.currentLeaf = parIt.GetFirstLeaf();
        this.isFirstLine = true;
      }
      else
      {
        this.currentLeaf = prevParaFormatInfo.GetLastLineInfo().endIter.GetNextLeaf();
        this.isFirstLine = false;
        ((ParagraphFormatInfo)this.renderInfo.FormatInfo).isStarting = false;
      }

      this.startLeaf = this.currentLeaf;
      this.currentVerticalInfo = CalcCurrentVerticalInfo();
      this.currentYPosition = area.Y + TopBorderOffset;
      this.formattingArea = area;
      Rectangle rect = this.formattingArea.GetFittingRect(this.currentYPosition, this.currentVerticalInfo.height);
      if (rect == null)
        return false;

      this.currentXPosition = rect.X + LeftIndent;
      if (this.isFirstLine)
        FormatListSymbol();

      return true;
    }
ParagraphRenderer