예제 #1
0
파일: Region.cs 프로젝트: ctddjyds/npoi
        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;
        }
예제 #2
0
파일: Region.cs 프로젝트: ctddjyds/npoi
 public static CellRangeAddress ConvertToCellRangeAddress(Region r)
 {
     return new CellRangeAddress(r.RowFrom, r.RowTo, r.ColumnFrom, r.ColumnTo);
 }
예제 #3
0
파일: Region.cs 프로젝트: ctddjyds/npoi
        /**
         * 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;
        }
예제 #4
0
 private static CellRange CreateFromRegion(Region r)
 {
     return new CellRange(r.RowFrom, r.RowTo, r.ColumnFrom, r.ColumnTo);
 }
예제 #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;
 }
예제 #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;
        }
예제 #7
0
 private static CellRangeAddress toCRA(Region region)
 {
     return Region.ConvertToCellRangeAddress(region);
 }