Exemplo n.º 1
0
        /// <summary>
        /// Begins a new vertical section in the layout
        /// </summary>
        /// <remarks>
        /// After calling this method, each subsequent call to <see cref="Add"/> will add controls in a vertical orientation.
        ///
        /// When finished adding controls to the vertical section, call either <see cref="EndVertical"/> or <see cref="EndBeginVertical"/>.
        /// </remarks>
        /// <returns>A new DynamicTable instance used for the vertical section</returns>
        /// <param name="padding">Padding to apply around the vertical section, or null to use the <see cref="DefaultPadding"/></param>
        /// <param name="spacing">Spacing to apply to cells in the vertical section, or null to use the <see cref="DefaultSpacing"/></param>
        /// <param name="xscale">Xscale of the vertical section</param>
        /// <param name="yscale">Yscale of the vertical section</param>
        public DynamicTable BeginVertical(Padding?padding = null, Size?spacing = null, bool?xscale = null, bool?yscale = null)
        {
            var newItem = new DynamicTable
            {
                Padding = padding,
                Spacing = spacing,
                XScale  = xscale,
                YScale  = yscale
            };

            currentItem.Add(newItem);
            currentItem = newItem;
            return(newItem);
        }
Exemplo n.º 2
0
        public void BeginVertical(Padding?padding = null, Size?spacing = null, bool?xscale = null, bool?yscale = null)
        {
            if (Generated)
            {
                throw new AlreadyGeneratedException();
            }
            var newItem = new DynamicTable {
                Parent  = currentItem ?? topTable,
                Padding = padding,
                Spacing = spacing,
                XScale  = xscale,
                YScale  = yscale
            };

            currentItem.Add(newItem);
            currentItem = newItem;
        }