iTextSharp.text.Paragraph.breakUp C# (CSharp) Метод

breakUp() публичный Метод

public breakUp ( ) : IList
Результат IList
        public IList<IElement> breakUp()
        {
            IList<IElement> list = new List<IElement>();
            Paragraph tmp = null;
            foreach (IElement e in this) {
                if (e.Type == Element.LIST || e.Type == Element.PTABLE || e.Type == Element.PARAGRAPH) {
                    if (tmp != null && tmp.Count > 0) {
                        tmp.SpacingAfter = 0;
                        list.Add(tmp);
                        tmp = cloneShallow(false);
                    }
                    if (list.Count == 0) {
                        switch (e.Type) {
                            case Element.PTABLE:
                                ((PdfPTable)e).SpacingBefore = SpacingBefore;
                                break;
                            case Element.PARAGRAPH:
                                ((Paragraph)e).SpacingBefore = SpacingBefore;
                                break;
                            case Element.LIST:
                                ListItem firstItem = ((List)e).GetFirstItem();
                                if (firstItem != null) {
                                    firstItem.SpacingBefore = SpacingBefore;
                                }
                                break;
                            default:
                                break;
                        }
                    }
                    list.Add(e);
                }
                else {
                    if (tmp == null) {
                        tmp = cloneShallow(list.Count == 0);
                    }
                    tmp.Add(e);
                }
            }
            if (tmp != null && tmp.Count > 0) {
                list.Add(tmp);
            }
            if (list.Count != 0) {
                IElement lastElement = list[list.Count - 1];
                switch (lastElement.Type) {
                    case Element.PTABLE:
                        ((PdfPTable)lastElement).SpacingAfter = SpacingAfter;
                        break;
                    case Element.PARAGRAPH:
                        ((Paragraph)lastElement).SpacingAfter = SpacingAfter;
                        break;
                    case Element.LIST:
                        ListItem lastItem = ((List)lastElement).GetLastItem();
                        if (lastItem != null) {
                            lastItem.SpacingAfter = SpacingAfter;
                        }
                        break;
                    default:
                        break;
                }
            }
            return list;
        }