/// <summary>
        /// Sets from flags.
        /// </summary>
        /// <param name="flags">The flags.</param>
        public void setFromFlags(cursorVariatorOddEvenFlags flags)
        {
            if ((flags & cursorVariatorOddEvenFlags.doOddEven) == cursorVariatorOddEvenFlags.doOddEven)
            {
                doOdd = true;
            }

            _minor = 0;

            if ((flags & cursorVariatorOddEvenFlags.doMinorOn5) == cursorVariatorOddEvenFlags.doMinorOn5)
            {
                _minor += 5;
            }
            if ((flags & cursorVariatorOddEvenFlags.doMinorOn10) == cursorVariatorOddEvenFlags.doMinorOn10)
            {
                _minor += 10;
            }
            if ((flags & cursorVariatorOddEvenFlags.doMinorOn20) == cursorVariatorOddEvenFlags.doMinorOn20)
            {
                _minor += 20;
            }

            _major = 0;

            if ((flags & cursorVariatorOddEvenFlags.doMajorOn2Minor) == cursorVariatorOddEvenFlags.doMajorOn2Minor)
            {
                _major += _minor * 2;
            }

            if ((flags & cursorVariatorOddEvenFlags.doMajorOn5Minor) == cursorVariatorOddEvenFlags.doMajorOn5Minor)
            {
                _major += _minor * 5;
            }

            if ((flags & cursorVariatorOddEvenFlags.doMajorOn10Minor) == cursorVariatorOddEvenFlags.doMajorOn10Minor)
            {
                _major += _minor * 10;
            }

            if ((flags & cursorVariatorOddEvenFlags.doMajorOn20Minor) == cursorVariatorOddEvenFlags.doMajorOn20Minor)
            {
                _major += _minor * 20;
            }
        }
        /// <summary>
        /// Sets the variator flags.
        /// </summary>
        /// <param name="data">The data.</param>
        /// <param name="headFoot">The head foot.</param>
        /// <param name="tableOps">The table ops.</param>
        /// <param name="oddEven">The odd even.</param>
        /// <param name="container">The container.</param>
        /// <returns></returns>
        public static PropertyCollection setVariatorFlags(this PropertyCollection data, cursorVariatorHeadFootFlags headFoot, appendTableOptionFlags tableOps, cursorVariatorOddEvenFlags oddEven, styleFourSide container)
        {
            if (data == null)
            {
                data = new PropertyCollection();
            }

            data.addObjectToMultikeys(headFoot, true, templateFieldStyle.style_headFootFlags);
            data.addObjectToMultikeys(tableOps, true, templateFieldStyle.style_appendTableOptionFlags);
            data.addObjectToMultikeys(oddEven, true, templateFieldStyle.style_oddEvenFlags);
            data.addObjectToMultikeys(container, true, templateFieldStyle.style_containerStyle);

            return(data);
        }
示例#3
0
 public dataProviderForStyler(cursorVariatorHeadFootFlags headFoot, appendTableOptionFlags tableOps, cursorVariatorOddEvenFlags oddEven, styleFourSide container, acePaletteRole mainColor, acePaletteRole layoutColor)
 {
     this.setColors(mainColor, layoutColor);
     this.setVariatorFlags(headFoot, tableOps, oddEven, container);
 }
示例#4
0
        /// <summary>
        /// Inserts DataTable content at current currsor position. Options: doInsertCaptions, doInsertRowID columnprefix (this is abanded)
        /// </summary>
        /// <param name="worksheet">The worksheet.</param>
        /// <param name="cur">The current.</param>
        /// <param name="data">The data.</param>
        /// <param name="doInsertCaptions">if set to <c>true</c> [do insert captions].</param>
        /// <param name="doInsertRowId">if set to <c>true</c> [do insert row identifier].</param>
        /// <returns>Range of newly populated cells, including automatically created extra row and column</returns>
        public static ExcelRange SetDataTable(this ExcelWorksheet worksheet, cursor cur, DataTable data, cursorVariatorHeadFootFlags headFootFlags, cursorVariatorOddEvenFlags oddEvenFlags)
        {
            int twidth  = data.Columns.Count;
            int theight = data.Rows.Count;

            bool doInsertCaptions = false;

            bool doInsertRowId = false;

            if (doInsertCaptions)
            {
                theight++;
            }

            if (doInsertRowId)
            {
                twidth++;
            }

            cur.setTempFrame(twidth, theight, textCursorZoneCorner.UpLeft, 0, 0); //.//.switchToZone(textCursorZone.innerZone, textCursorZoneCorner.UpLeft);
            cur.switchToZone(textCursorZone.innerZone);

            if (doInsertCaptions)
            {
                if (doInsertRowId)
                {
                    SetValue(worksheet, cur, "#", false, textCursorZoneCorner.Right);
                }
                foreach (DataColumn dc in data.Columns)
                {
                    SetValue(worksheet, cur, dc.Caption, false, textCursorZoneCorner.Right);
                }
                cur.enter();
            }

            foreach (DataRow rw in data.Rows)
            {
                if (doInsertRowId)
                {
                    SetValue(worksheet, cur, data.Rows.IndexOf(rw), false, textCursorZoneCorner.Right);
                }
                foreach (DataColumn dc in data.Columns)
                {
                    SetValue(worksheet, cur, rw[dc], false, textCursorZoneCorner.Right);
                }
                cur.enter();
            }

            var area = cur.selectZoneArea();

            cur.backToMainFrame();

            return(area.getExcelRange(worksheet));
        }