/// <summary>
        /// Get the width of the specified columns.
        /// </summary>
        /// <param name="Unit">The unit of the width to be returned.</param>
        /// <param name="StartColumnIndex">The column index of the start column.</param>
        /// <param name="EndColumnIndex">The column index of the end column.</param>
        /// <returns>The width in the specified unit type.</returns>
        public double GetWidth(SLMeasureUnitTypeValues Unit, int StartColumnIndex, int EndColumnIndex)
        {
            if (StartColumnIndex < 1)
            {
                StartColumnIndex = 1;
            }
            if (StartColumnIndex > SLConstants.ColumnLimit)
            {
                StartColumnIndex = SLConstants.ColumnLimit;
            }
            if (EndColumnIndex < 1)
            {
                EndColumnIndex = 1;
            }
            if (EndColumnIndex > SLConstants.ColumnLimit)
            {
                EndColumnIndex = SLConstants.ColumnLimit;
            }

            long lWidth = 0;
            int  i      = 0;
            SLColumnProperties cp;

            for (i = StartColumnIndex; i <= EndColumnIndex; ++i)
            {
                if (slws.ColumnProperties.ContainsKey(i))
                {
                    cp      = slws.ColumnProperties[i];
                    lWidth += cp.WidthInEMU;
                }
                else
                {
                    lWidth += slws.SheetFormatProperties.DefaultColumnWidthInEMU;
                }
            }

            double result = 0;

            switch (Unit)
            {
            case SLMeasureUnitTypeValues.Centimeter:
                result = SLConvert.FromEmuToCentimeter((double)lWidth);
                break;

            case SLMeasureUnitTypeValues.Emu:
                result = (double)lWidth;
                break;

            case SLMeasureUnitTypeValues.Inch:
                result = SLConvert.FromEmuToInch((double)lWidth);
                break;

            case SLMeasureUnitTypeValues.Point:
                result = SLConvert.FromEmuToPoint((double)lWidth);
                break;
            }

            return(result);
        }
        /// <summary>
        /// Get the height of specified rows.
        /// </summary>
        /// <param name="Unit">The unit of the height to be returned.</param>
        /// <param name="StartRowIndex">The row index of the start row.</param>
        /// <param name="EndRowIndex">The row index of the end row.</param>
        /// <returns>The height in the specified unit type.</returns>
        public double GetHeight(SLMeasureUnitTypeValues Unit, int StartRowIndex, int EndRowIndex)
        {
            if (StartRowIndex < 1)
            {
                StartRowIndex = 1;
            }
            if (StartRowIndex > SLConstants.RowLimit)
            {
                StartRowIndex = SLConstants.RowLimit;
            }
            if (EndRowIndex < 1)
            {
                EndRowIndex = 1;
            }
            if (EndRowIndex > SLConstants.RowLimit)
            {
                EndRowIndex = SLConstants.RowLimit;
            }

            long            lHeight = 0;
            int             i       = 0;
            SLRowProperties rp;

            for (i = StartRowIndex; i <= EndRowIndex; ++i)
            {
                if (slws.RowProperties.ContainsKey(i))
                {
                    rp       = slws.RowProperties[i];
                    lHeight += rp.HeightInEMU;
                }
                else
                {
                    lHeight += slws.SheetFormatProperties.DefaultRowHeightInEMU;
                }
            }

            double result = 0;

            switch (Unit)
            {
            case SLMeasureUnitTypeValues.Centimeter:
                result = SLConvert.FromEmuToCentimeter((double)lHeight);
                break;

            case SLMeasureUnitTypeValues.Emu:
                result = (double)lHeight;
                break;

            case SLMeasureUnitTypeValues.Inch:
                result = SLConvert.FromEmuToInch((double)lHeight);
                break;

            case SLMeasureUnitTypeValues.Point:
                result = SLConvert.FromEmuToPoint((double)lHeight);
                break;
            }

            return(result);
        }
 /// <summary>
 /// Get the height of the specified row.
 /// </summary>
 /// <param name="Unit">The unit of the height to be returned.</param>
 /// <param name="RowIndex">The row index.</param>
 /// <returns>The height in the specified unit type.</returns>
 public double GetHeight(SLMeasureUnitTypeValues Unit, int RowIndex)
 {
     return(this.GetHeight(Unit, RowIndex, RowIndex));
 }
Exemplo n.º 4
0
        /// <summary>
        /// Get the width of the specified columns.
        /// </summary>
        /// <param name="Unit">The unit of the width to be returned.</param>
        /// <param name="StartColumnIndex">The column index of the start column.</param>
        /// <param name="EndColumnIndex">The column index of the end column.</param>
        /// <returns>The width in the specified unit type.</returns>
        public double GetWidth(SLMeasureUnitTypeValues Unit, int StartColumnIndex, int EndColumnIndex)
        {
            if (StartColumnIndex < 1) StartColumnIndex = 1;
            if (StartColumnIndex > SLConstants.ColumnLimit) StartColumnIndex = SLConstants.ColumnLimit;
            if (EndColumnIndex < 1) EndColumnIndex = 1;
            if (EndColumnIndex > SLConstants.ColumnLimit) EndColumnIndex = SLConstants.ColumnLimit;

            long lWidth = 0;
            int i = 0;
            SLColumnProperties cp;
            for (i = StartColumnIndex; i <= EndColumnIndex; ++i)
            {
                if (slws.ColumnProperties.ContainsKey(i))
                {
                    cp = slws.ColumnProperties[i];
                    lWidth += cp.WidthInEMU;
                }
                else
                {
                    lWidth += slws.SheetFormatProperties.DefaultColumnWidthInEMU;
                }
            }

            double result = 0;
            switch (Unit)
            {
                case SLMeasureUnitTypeValues.Centimeter:
                    result = SLConvert.FromEmuToCentimeter((double)lWidth);
                    break;
                case SLMeasureUnitTypeValues.Emu:
                    result = (double)lWidth;
                    break;
                case SLMeasureUnitTypeValues.Inch:
                    result = SLConvert.FromEmuToInch((double)lWidth);
                    break;
                case SLMeasureUnitTypeValues.Point:
                    result = SLConvert.FromEmuToPoint((double)lWidth);
                    break;
            }

            return result;
        }
Exemplo n.º 5
0
 /// <summary>
 /// Get the width of the specified column.
 /// </summary>
 /// <param name="Unit">The unit of the width to be returned.</param>
 /// <param name="ColumnIndex">The column index.</param>
 /// <returns>The width in the specified unit type.</returns>
 public double GetWidth(SLMeasureUnitTypeValues Unit, int ColumnIndex)
 {
     return this.GetWidth(Unit, ColumnIndex, ColumnIndex);
 }
Exemplo n.º 6
0
        /// <summary>
        /// Get the width of the specified columns.
        /// </summary>
        /// <param name="Unit">The unit of the width to be returned.</param>
        /// <param name="StartColumnName">The column name of the start column.</param>
        /// <param name="EndColumnName">The column name of the end column.</param>
        /// <returns>The width in the specified unit type.</returns>
        public double GetWidth(SLMeasureUnitTypeValues Unit, string StartColumnName, string EndColumnName)
        {
            int iStartColumnIndex = -1;
            int iEndColumnIndex = -1;
            iStartColumnIndex = SLTool.ToColumnIndex(StartColumnName);
            iEndColumnIndex = SLTool.ToColumnIndex(EndColumnName);

            return this.GetWidth(Unit, iStartColumnIndex, iEndColumnIndex);
        }
Exemplo n.º 7
0
        /// <summary>
        /// Get the width of the specified column.
        /// </summary>
        /// <param name="Unit">The unit of the width to be returned.</param>
        /// <param name="ColumnName">The column name, such as "A".</param>
        /// <returns>The width in the specified unit type.</returns>
        public double GetWidth(SLMeasureUnitTypeValues Unit, string ColumnName)
        {
            int iColumnIndex = -1;
            iColumnIndex = SLTool.ToColumnIndex(ColumnName);

            return this.GetWidth(Unit, iColumnIndex, iColumnIndex);
        }
Exemplo n.º 8
0
        /// <summary>
        /// Get the height of specified rows.
        /// </summary>
        /// <param name="Unit">The unit of the height to be returned.</param>
        /// <param name="StartRowIndex">The row index of the start row.</param>
        /// <param name="EndRowIndex">The row index of the end row.</param>
        /// <returns>The height in the specified unit type.</returns>
        public double GetHeight(SLMeasureUnitTypeValues Unit, int StartRowIndex, int EndRowIndex)
        {
            if (StartRowIndex < 1) StartRowIndex = 1;
            if (StartRowIndex > SLConstants.RowLimit) StartRowIndex = SLConstants.RowLimit;
            if (EndRowIndex < 1) EndRowIndex = 1;
            if (EndRowIndex > SLConstants.RowLimit) EndRowIndex = SLConstants.RowLimit;

            long lHeight = 0;
            int i = 0;
            SLRowProperties rp;
            for (i = StartRowIndex; i <= EndRowIndex; ++i)
            {
                if (slws.RowProperties.ContainsKey(i))
                {
                    rp = slws.RowProperties[i];
                    lHeight += rp.HeightInEMU;
                }
                else
                {
                    lHeight += slws.SheetFormatProperties.DefaultRowHeightInEMU;
                }
            }

            double result = 0;
            switch (Unit)
            {
                case SLMeasureUnitTypeValues.Centimeter:
                    result = SLConvert.FromEmuToCentimeter((double)lHeight);
                    break;
                case SLMeasureUnitTypeValues.Emu:
                    result = (double)lHeight;
                    break;
                case SLMeasureUnitTypeValues.Inch:
                    result = SLConvert.FromEmuToInch((double)lHeight);
                    break;
                case SLMeasureUnitTypeValues.Point:
                    result = SLConvert.FromEmuToPoint((double)lHeight);
                    break;
            }

            return result;
        }
Exemplo n.º 9
0
 /// <summary>
 /// Get the height of the specified row.
 /// </summary>
 /// <param name="Unit">The unit of the height to be returned.</param>
 /// <param name="RowIndex">The row index.</param>
 /// <returns>The height in the specified unit type.</returns>
 public double GetHeight(SLMeasureUnitTypeValues Unit, int RowIndex)
 {
     return this.GetHeight(Unit, RowIndex, RowIndex);
 }