Esempio n. 1
0
 static void SetAxisBorder(Worksheet workSheet, SheetArea sheetArea, int index, int count, bool[] flags, BorderLine[] lines, bool isRowDirection)
 {
     for (int i = 0; i < count; i++)
     {
         int       row    = isRowDirection ? (index + i) : -1;
         int       column = isRowDirection ? -1 : (index + i);
         StyleInfo style  = workSheet.GetStyleInfo(row, column, sheetArea);
         if (style == null)
         {
             style = new StyleInfo();
         }
         UpdateStyle(style, flags, lines);
         workSheet.SetStyleInfo(row, column, sheetArea, style);
     }
 }
Esempio n. 2
0
 static void SetCellBorder(Worksheet workSheet, SheetArea sheetArea, int row, int rowCount, int column, int columnCount, bool[] flags, BorderLine[] lines, bool isinside, bool clear = false)
 {
     for (int i = 0; i < rowCount; i++)
     {
         for (int j = 0; j < columnCount; j++)
         {
             if (isinside)
             {
                 if (!clear)
                 {
                     if (i == (rowCount - 1))
                     {
                         flags[3] = false;
                     }
                     if (j == (columnCount - 1))
                     {
                         flags[2] = false;
                     }
                 }
                 else
                 {
                     if (i == 0)
                     {
                         flags[1] = false;
                     }
                     if (j == 0)
                     {
                         flags[0] = false;
                     }
                 }
             }
             StyleInfo style = workSheet.GetStyleInfo(i + row, j + column, sheetArea);
             if (style == null)
             {
                 style = new StyleInfo();
             }
             UpdateStyle(style, flags, lines);
             workSheet.SetStyleInfo(i + row, j + column, sheetArea, style);
             if (isinside)
             {
                 if (!clear)
                 {
                     if (lines[3] != null)
                     {
                         flags[3] = true;
                     }
                     if (lines[2] != null)
                     {
                         flags[2] = true;
                     }
                 }
                 else
                 {
                     if (lines[1] == null)
                     {
                         flags[1] = true;
                     }
                     if (lines[0] == null)
                     {
                         flags[0] = true;
                     }
                 }
             }
         }
     }
 }