コード例 #1
0
        /// <summary>
        /// Creates an instance of SLDataValidation.
        /// </summary>
        /// <param name="StartCellReference">The cell reference of the start cell of the cell range, such as "A1". This is typically the top-left cell.</param>
        /// <param name="EndCellReference">The cell reference of the end cell of the cell range, such as "A1". This is typically the bottom-right cell.</param>
        /// <returns>An SLDataValidation.</returns>
        public SLDataValidation CreateDataValidation(string StartCellReference, string EndCellReference)
        {
            int iStartRowIndex = -1;
            int iStartColumnIndex = -1;
            int iEndRowIndex = -1;
            int iEndColumnIndex = -1;
            if (!SLTool.FormatCellReferenceToRowColumnIndex(StartCellReference, out iStartRowIndex, out iStartColumnIndex)
                || !SLTool.FormatCellReferenceToRowColumnIndex(EndCellReference, out iEndRowIndex, out iEndColumnIndex))
            {
                iStartRowIndex = 1;
                iStartColumnIndex = 1;
                iEndRowIndex = 1;
                iEndColumnIndex = 1;
            }

            SLDataValidation dv = new SLDataValidation();
            dv.InitialiseDataValidation(iStartRowIndex, iStartColumnIndex, iEndRowIndex, iEndColumnIndex, slwb.WorkbookProperties.Date1904);
            return dv;
        }
コード例 #2
0
 /// <summary>
 /// Creates an instance of SLDataValidation.
 /// </summary>
 /// <param name="StartRowIndex">The row index of the start row.</param>
 /// <param name="StartColumnIndex">The column index of the start column.</param>
 /// <param name="EndRowIndex">The row index of the end row.</param>
 /// <param name="EndColumnIndex">The column index of the end column.</param>
 /// <returns>An SLDataValidation.</returns>
 public SLDataValidation CreateDataValidation(int StartRowIndex, int StartColumnIndex, int EndRowIndex, int EndColumnIndex)
 {
     SLDataValidation dv = new SLDataValidation();
     dv.InitialiseDataValidation(StartRowIndex, StartColumnIndex, EndRowIndex, EndColumnIndex, slwb.WorkbookProperties.Date1904);
     return dv;
 }
コード例 #3
0
        /// <summary>
        /// Creates an instance of SLDataValidation.
        /// </summary>
        /// <param name="CellReference">The cell reference, such as "A1".</param>
        /// <returns>An SLDataValidation.</returns>
        public SLDataValidation CreateDataValidation(string CellReference)
        {
            int iRowIndex = -1;
            int iColumnIndex = -1;
            if (!SLTool.FormatCellReferenceToRowColumnIndex(CellReference, out iRowIndex, out iColumnIndex))
            {
                iRowIndex = 1;
                iColumnIndex = 1;
            }

            SLDataValidation dv = new SLDataValidation();
            dv.InitialiseDataValidation(iRowIndex, iColumnIndex, iRowIndex, iColumnIndex, slwb.WorkbookProperties.Date1904);
            return dv;
        }