protected bool DoConvertSplit(StyleBase style, object value, out OverflowSplit split)
        {
            OverflowAction?actions;
            OverflowSplit? splits;

            if (null == value)
            {
                split = OverflowSplit.Any;
                return(false);
            }
            else if (value is OverflowSplit s)
            {
                split = s;
                return(true);
            }
            else if (TryParseOverflow(value.ToString(), out splits, out actions) && splits.HasValue)
            {
                split = splits.Value;
                return(true);
            }
            else
            {
                split = OverflowSplit.Any;
                return(false);
            }
        }
        public void Overflow_SplitTest()
        {
            OverflowStyle target   = new OverflowStyle();
            OverflowSplit expected = OverflowSplit.Any;

            Assert.AreEqual(expected, target.Split);

            expected     = OverflowSplit.Never;
            target.Split = expected;
            Assert.AreEqual(expected, target.Split);

            expected     = OverflowSplit.Any;
            target.Split = expected;
            Assert.AreEqual(expected, target.Split);

            target.RemoveSplit();
            expected = OverflowSplit.Any;
            Assert.AreEqual(expected, target.Split);
        }
Beispiel #3
0
        //
        // methods
        //

        #region public void InitPage(int index, PDFSize size, PDFThickness margthick ...)

        /// <summary>
        /// Initializes this page with the required top block size and other measurements
        /// </summary>
        /// <param name="size"></param>
        /// <param name="margthick"></param>
        /// <param name="padthick"></param>
        /// <param name="available"></param>
        /// <param name="mode"></param>
        /// <param name="cansplit"></param>
        /// <param name="colcount"></param>
        /// <param name="alley"></param>
        public virtual void InitPage(PDFSize size, PDFPositionOptions options, PDFColumnOptions columns, PDFLayoutContext context)
        {
            this.Size            = size;
            this.PositionOptions = options;

            OverflowSplit split = options.OverflowSplit;


            PDFLayoutBlock block       = new PDFLayoutBlock(this, this.Owner, this.Engine, this.FullStyle, split);
            PDFRect        totalbounds = new PDFRect(PDFPoint.Empty, this.Size);


            block.InitRegions(totalbounds, options, columns, context);

            //We need to set the bounds of the page block to the total for a page
            //(as margins are taken off from the size of the page
            // - this is different to a block where margins increase any explicit sizes).
            block.TotalBounds = totalbounds;

            this.ContentBlock = block;
            this.CurrentBlock = block;
        }