コード例 #1
0
        public static LayoutElement NewRow(IEnumerable<LayoutElement> nodes, 
            LayoutElementType type = LayoutElementType.Row)
        {
            RectangleF dummyBounds = new RectangleF(0,0,1,1);
            var e = new LayoutElement(type, dummyBounds, null, nodes);

            // set bounds
            if (!nodes.IsEmpty())
            {
                e.Text = nodes.Select(x => x.Text).Where(x => !String.IsNullOrEmpty(x)).ElementsToStringS(delim: " ");
                e.SetBoundsFromNodes(false);
            }

            return e;
        }
コード例 #2
0
        void TryAddRow(List<LayoutElement> rows, LayoutElement currentRow)
        {
            if (currentRow == null) { return; }

            currentRow.Children = currentRow.Children.Distinct().ToList();
            currentRow.SetBoundsFromNodes(false);
            rows.Add(currentRow);
        }