Beispiel #1
0
        public static CellRangeAddress[] ConvertRegionsToCellRanges(Region[] regions)
        {
            int size = regions.Length;
            if (size < 1)
            {
                return new CellRangeAddress[0];
            }

            CellRangeAddress[] result = new CellRangeAddress[size];

            for (int i = 0; i != size; i++)
            {
                result[i] = ConvertToCellRangeAddress(regions[i]);
            }
            return result;
        }
Beispiel #2
0
 public static CellRangeAddress ConvertToCellRangeAddress(Region r)
 {
     return new CellRangeAddress(r.RowFrom, r.RowTo, r.ColumnFrom, r.ColumnTo);
 }
Beispiel #3
0
        /**
         * Convert a List of CellRange objects to an array of regions 
         *  
         * @param List of CellRange objects
         * @return regions
         */
        public static Region[] ConvertCellRangesToRegions(CellRangeAddress[] cellRanges)
        {
            int size = cellRanges.Length;
            if (size < 1)
            {
                return new Region[0];
            }

            Region[] result = new Region[size];

            for (int i = 0; i != size; i++)
            {
                result[i] = ConvertToRegion(cellRanges[i]);
            }
            return result;
        }
Beispiel #4
0
 private static CellRange CreateFromRegion(Region r)
 {
     return new CellRange(r.RowFrom, r.RowTo, r.ColumnFrom, r.ColumnTo);
 }
Beispiel #5
0
 /**
  * Convert array of regions to a List of CellRange objects
  *
  * @param regions
  * @return List of CellRange objects
  */
 public static CellRange[] ConvertRegionsToCellRanges(Region[] regions)
 {
     CellRange[] result = new CellRange[regions.Length];
     for (int i = 0; i < regions.Length; i++)
     {
         result[i] = CreateFromRegion(regions[i]);
     }
     return result;
 }
Beispiel #6
0
        /**
         * Convert a List of CellRange objects to an array of regions
         *
         * @param List of CellRange objects
         * @return regions
         */
        public static Region[] ConvertCellRangesToRegions(CellRange[] cellRanges)
        {
            int size = cellRanges.Length;
            if (size < 1)
            {
                return EMPTY_REGION_ARRAY;
            }

            Region[] result = new Region[size];

            for (int i = 0; i != size; i++)
            {
                result[i] = cellRanges[i].ConvertToRegion();
            }
            return result;
        }
 private static CellRangeAddress toCRA(Region region)
 {
     return Region.ConvertToCellRangeAddress(region);
 }