コード例 #1
0
ファイル: Extensions.cs プロジェクト: hempe/budget-planner
        public static ExcelCell Left(this ExcelCell @this, int indent)
        {
            @this.Cells().Style.Indent = indent;
            @this.Cells().Style.HorizontalAlignment = ExcelHorizontalAlignment.Left;

            return(@this);
        }
コード例 #2
0
ファイル: Extensions.cs プロジェクト: hempe/budget-planner
        public static ExcelCell Cells(this ExcelWorksheet @this, int row, int col, int rows = 0, int cols = 0)
        {
            var cell = new ExcelCell
            {
                Row       = row,
                Col       = col,
                Rows      = rows,
                Cols      = cols,
                Worksheet = @this
            };

            cell.Worksheet.Cells[cell.Row, cell.Col, cell.Row + cell.Rows, cell.Col + cell.Cols].Style.VerticalAlignment = ExcelVerticalAlignment.Center;
            return(cell);
        }
コード例 #3
0
ファイル: Extensions.cs プロジェクト: hempe/budget-planner
 public static ExcelCell BackgroundColor(this ExcelCell @this, int r, int g, int b)
 {
     @this.Cells().Style.Fill.PatternType = ExcelFillStyle.Solid;
     @this.Cells().Style.Fill.BackgroundColor.SetColor(Color.FromArgb(r, g, b));
     return(@this);
 }
コード例 #4
0
ファイル: Extensions.cs プロジェクト: hempe/budget-planner
 public static ExcelCell FontSize(this ExcelCell @this, int value)
 {
     @this.Cells().Style.Font.Size = value;
     return(@this);
 }
コード例 #5
0
ファイル: Extensions.cs プロジェクト: hempe/budget-planner
 public static ExcelCell Bold(this ExcelCell @this)
 {
     @this.Cells().Style.Font.Bold = true;
     return(@this);
 }
コード例 #6
0
ファイル: Extensions.cs プロジェクト: hempe/budget-planner
 public static ExcelCell FontColor(this ExcelCell @this, int r, int g, int b)
 {
     @this.Cells().Style.Font.Color.SetColor(Color.FromArgb(r, g, b));
     return(@this);
 }
コード例 #7
0
ファイル: Extensions.cs プロジェクト: hempe/budget-planner
 public static ExcelCell BorderTop(this ExcelCell @this, ExcelBorderStyle style, Color color)
 {
     @this.Cells().Style.Border.Top.Style = style;
     @this.Cells().Style.Border.Top.Color.SetColor(color);
     return(@this);
 }
コード例 #8
0
ファイル: Extensions.cs プロジェクト: hempe/budget-planner
 public static ExcelCell Style(this ExcelCell @this, Action <ExcelStyle> action)
 {
     action(@this.Cells().Style);
     return(@this);
 }
コード例 #9
0
ファイル: Extensions.cs プロジェクト: hempe/budget-planner
 public static ExcelCell Merge(this ExcelCell @this)
 {
     @this.Worksheet.Cells[@this.Row, @this.Col, @this.Row + @this.Rows, @this.Col + @this.Cols].Merge = true;
     return(@this);
 }
コード例 #10
0
ファイル: Extensions.cs プロジェクト: hempe/budget-planner
 public static ExcelCell Formula(this ExcelCell @this, string value)
 {
     @this.Cells().Formula = value;
     return(@this);
 }
コード例 #11
0
ファイル: Extensions.cs プロジェクト: hempe/budget-planner
 public static ExcelCell Value(this ExcelCell @this, object value)
 {
     @this.Cells().Value = value;
     return(@this);
 }
コード例 #12
0
ファイル: Extensions.cs プロジェクト: hempe/budget-planner
 public static ExcelCell Set(this ExcelCell @this, Action <ExcelRangeBase> action)
 {
     action(@this.Cells());
     return(@this);
 }
コード例 #13
0
ファイル: Extensions.cs プロジェクト: hempe/budget-planner
 public static ExcelCell Width(this ExcelCell @this, int value)
 {
     @this.Worksheet.Column(@this.Col).Width = value;
     return(@this);
 }
コード例 #14
0
ファイル: Extensions.cs プロジェクト: hempe/budget-planner
 public static ExcelCell Column(this ExcelCell @this, Action <ExcelColumn> action)
 {
     action(@this.Worksheet.Column(@this.Col));
     return(@this);
 }
コード例 #15
0
ファイル: Extensions.cs プロジェクト: hempe/budget-planner
 public static ExcelCell Height(this ExcelCell @this, int value)
 {
     @this.Worksheet.Row(@this.Row).Height = value;
     return(@this);
 }
コード例 #16
0
ファイル: Extensions.cs プロジェクト: hempe/budget-planner
 public static ExcelCell Numberformat(this ExcelCell @this, string format)
 {
     @this.Cells().Style.Numberformat.Format = format;
     return(@this);
 }
コード例 #17
0
ファイル: Extensions.cs プロジェクト: hempe/budget-planner
 public static ExcelCell Center(this ExcelCell @this)
 {
     @this.Cells().Style.HorizontalAlignment = ExcelHorizontalAlignment.Center;
     return(@this);
 }
コード例 #18
0
ファイル: Extensions.cs プロジェクト: hempe/budget-planner
 public static ExcelRangeBase Cells(this ExcelCell cell)
 {
     return(cell.Worksheet.Cells[cell.Row, cell.Col, cell.Row + cell.Rows, cell.Col + cell.Cols]);
 }