浏览代码

Added patches 7389 and 7421 submitted by lckuiper. These patches contains support for Cell Margins and Table\Cell borders.

Thank you for sharing your custom features with the group lckuiper.
master
coffeycathal_cp 15 年前
父节点
当前提交
b7c5db65d3
共有 4 个文件被更改,包括 1128 次插入0 次删除
  1. 60
    0
      DocX/Border.cs
  2. 1
    0
      DocX/DocX.csproj
  3. 987
    0
      DocX/Table.cs
  4. 80
    0
      DocX/_Enumerations.cs

+ 60
- 0
DocX/Border.cs 查看文件

@@ -0,0 +1,60 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
namespace Novacode
{
/// <summary>
/// Represents a border of a table or table cell
/// Added by lckuiper @ 20101117
/// </summary>
public class Border
{
BorderStyle tcbs;
Color color;
BorderSize size;
int space;
public BorderStyle Tcbs
{
get { return tcbs; }
set { tcbs = value; }
}
public BorderSize Size
{
get { return size; }
set { size = value; }
}
public int Space
{
get { return space; }
set { space = value; }
}
public Color Color
{
get { return color; }
set { color = value; }
}
public Border()
{
this.tcbs = BorderStyle.Tcbs_single;
this.size = BorderSize.one;
this.space = 0;
this.color = Color.Black;
}
public Border(BorderStyle tcbs, BorderSize size, int space, Color color)
{
this.Tcbs = tcbs;
this.size = size;
this.space = space;
this.Color = color;
}
}
}

+ 1
- 0
DocX/DocX.csproj 查看文件

@@ -81,6 +81,7 @@
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Border.cs" />
<Compile Include="Container.cs" />
<Compile Include="Footers.cs" />
<Compile Include="Footer.cs" />

+ 987
- 0
DocX/Table.cs
文件差异内容过多而无法显示
查看文件


+ 80
- 0
DocX/_Enumerations.cs 查看文件

@@ -5,6 +5,86 @@ using System.Text;
namespace Novacode
{
public enum BorderSize
{
one,
two,
three,
four,
five,
six,
seven,
eight,
nine
}
/// <summary>
/// Table Cell Border styles
/// Added by lckuiper @ 20101117
/// source: http://msdn.microsoft.com/en-us/library/documentformat.openxml.wordprocessing.tablecellborders.aspx
/// </summary>
public enum BorderStyle
{
Tcbs_none = 0,
Tcbs_single,
Tcbs_thick,
Tcbs_double,
Tcbs_dotted,
Tcbs_dashed,
Tcbs_dotDash,
Tcbs_dotDotDash,
Tcbs_triple,
Tcbs_thinThickSmallGap,
Tcbs_thickThinSmallGap,
Tcbs_thinThickThinSmallGap,
Tcbs_thinThickMediumGap,
Tcbs_thickThinMediumGap,
Tcbs_thinThickThinMediumGap,
Tcbs_thinThickLargeGap,
Tcbs_thickThinLargeGap,
Tcbs_thinThickThinLargeGap,
Tcbs_wave,
Tcbs_doubleWave,
Tcbs_dashSmallGap,
Tcbs_dashDotStroked,
Tcbs_threeDEmboss,
Tcbs_threeDEngrave,
Tcbs_outset,
Tcbs_inset
}
/// <summary>
/// Table Cell Border Types
/// Added by lckuiper @ 20101117
/// source: http://msdn.microsoft.com/en-us/library/documentformat.openxml.wordprocessing.tablecellborders.aspx
/// </summary>
public enum TableCellBorderType
{
Top,
Bottom,
Left,
Right,
InsideH,
InsideV,
TopLeftToBottomRight,
TopRightToBottomLeft
}
/// <summary>
/// Table Border Types
/// Added by lckuiper @ 20101117
/// source: http://msdn.microsoft.com/en-us/library/documentformat.openxml.wordprocessing.tableborders.aspx
/// </summary>
public enum TableBorderType
{
Top,
Bottom,
Left,
Right,
InsideH,
InsideV
}
// Patch 7398 added by lckuiper on Nov 16th 2010 @ 2:23 PM
public enum VerticalAlignment { Top, Center, Bottom };

正在加载...
取消
保存