示例#1
0
        public static void SetBorder(XmlElement XmlElement, BorderCode borderCode, String where)
        {
            if (XmlElement == null)
                throw new ArgumentException("XmlElement is null");

            if (borderCode == null || borderCode.BorderType == 0)
                return;

            if (string.IsNullOrEmpty(where))
            {
                XmlElement.SetAttribute("border-style", GetBorderType(borderCode));
                XmlElement.SetAttribute("border-color",
                        GetColor(borderCode.Color));
                XmlElement.SetAttribute("border-width", GetBorderWidth(borderCode));
            }
            else
            {
                XmlElement.SetAttribute("border-" + where + "-style",
                        GetBorderType(borderCode));
                XmlElement.SetAttribute("border-" + where + "-color",
                        GetColor(borderCode.Color));
                XmlElement.SetAttribute("border-" + where + "-width",
                        GetBorderWidth(borderCode));
            }
        }
示例#2
0
        public static void AddBorder(BorderCode borderCode, String where, StringBuilder style)
        {
            if (borderCode == null || borderCode.IsEmpty)
                return;

            if (string.IsNullOrEmpty(where))
            {
                style.Append("border:");
            }
            else
            {
                style.Append("border-");
                style.Append(where);
            }

            style.Append(":");
            if (borderCode.LineWidth < 8)
                style.Append("thin");
            else
                style.Append(GetBorderWidth(borderCode));
            style.Append(' ');
            style.Append(GetBorderType(borderCode));
            style.Append(' ');
            style.Append(GetColor(borderCode.Color));
            style.Append(';');
        }
示例#3
0
 public SectionProperties()
 {
     field_20_brcTop        = new BorderCode();
     field_21_brcLeft       = new BorderCode();
     field_22_brcBottom     = new BorderCode();
     field_23_brcRight      = new BorderCode();
     field_26_dttmPropRMark = new DateAndTime();
 }
示例#4
0
 public SectionProperties()
 {
     field_20_brcTop = new BorderCode();
     field_21_brcLeft = new BorderCode();
     field_22_brcBottom = new BorderCode();
     field_23_brcRight = new BorderCode();
     field_26_dttmPropRMark = new DateAndTime();
 }
示例#5
0
        int _ico24 = -1; // default to -1 so we can ignore it for word 97 files

        public CharacterProperties()
        {
            field_17_fcPic            = -1;
            field_22_dttmRMark        = new DateAndTime();
            field_23_dttmRMarkDel     = new DateAndTime();
            field_36_dttmPropRMark    = new DateAndTime();
            field_40_dttmDispFldRMark = new DateAndTime();
            field_41_xstDispFldRMark  = new byte[36];
            field_42_shd        = new ShadingDescriptor();
            field_43_brc        = new BorderCode();
            field_7_hps         = 20;
            field_24_istd       = 10;
            field_16_wCharScale = 100;
            field_13_lidDefault = 0x0400;
            field_14_lidFE      = 0x0400;
        }
示例#6
0
 public TableProperties(int columns)
 {
     field_7_itcMac = (short)columns;
     field_10_rgshd = new ShadingDescriptor[columns];
     for (int x = 0; x < columns; x++)
     {
         field_10_rgshd[x] = new ShadingDescriptor();
     }
     field_11_brcBottom     = new BorderCode();
     field_12_brcTop        = new BorderCode();
     field_13_brcLeft       = new BorderCode();
     field_14_brcRight      = new BorderCode();
     field_15_brcVertical   = new BorderCode();
     field_16_brcHorizontal = new BorderCode();
     field_8_rgdxaCenter    = new short[columns];
     field_9_rgtc           = new TableCellDescriptor[columns];
     for (int x = 0; x < columns; x++)
     {
         field_9_rgtc[x] = new TableCellDescriptor();
     }
 }
示例#7
0
 public TableProperties(int columns)
 {
     field_7_itcMac = (short)columns;
     field_10_rgshd = new ShadingDescriptor[columns];
     for (int x = 0; x < columns; x++)
     {
         field_10_rgshd[x] = new ShadingDescriptor();
     }
     field_11_brcBottom = new BorderCode();
     field_12_brcTop = new BorderCode();
     field_13_brcLeft = new BorderCode();
     field_14_brcRight = new BorderCode();
     field_15_brcVertical = new BorderCode();
     field_16_brcHorizontal = new BorderCode();
     field_8_rgdxaCenter = new short[columns];
     field_9_rgtc = new TableCellDescriptor[columns];
     for (int x = 0; x < columns; x++)
     {
         field_9_rgtc[x] = new TableCellDescriptor();
     }
 }
示例#8
0
 public void SetRightBorder(BorderCode right)
 {
     base.SetBrcRight(right);
 }
示例#9
0
 public void SetBottomBorder(BorderCode bottom)
 {
     base.SetBrcBottom(bottom);
 }
示例#10
0
文件: Paragraph.cs 项目: zzy092/npoi
 public void SetBarBorder(BorderCode bar)
 {
     _props.SetBrcBar(bar);
     _papx.UpdateSprm(SPRM_BRCBAR, bar.ToInt());
 }
示例#11
0
文件: Paragraph.cs 项目: zzy092/npoi
 public void SetBottomBorder(BorderCode bottom)
 {
     _props.SetBrcBottom(bottom);
     _papx.UpdateSprm(SPRM_BRCBOTTOM, bottom.ToInt());
 }
示例#12
0
 /**
  * Set the brcBar field for the PAP record.
  */
 public void SetBrcBar(BorderCode field_66_brcBar)
 {
     this.field_66_brcBar = field_66_brcBar;
 }
示例#13
0
 /**
  * Set the brcHorizontal field for the TAP record.
  */
 public void SetBrcHorizontal(BorderCode field_16_brcHorizontal)
 {
     this.field_16_brcHorizontal = field_16_brcHorizontal;
 }
示例#14
0
 public void SetTopBorder(BorderCode top)
 {
     base.SetBrcTop(top);
 }
示例#15
0
 public void SetRightBorder(BorderCode right)
 {
     base.SetBrcRight(right);
 }
示例#16
0
 public void SetLeftBorder(BorderCode left)
 {
     base.SetBrcLeft(left);
 }
示例#17
0
 public void SetBottomBorder(BorderCode bottom)
 {
     base.SetBrcBottom(bottom);
 }
示例#18
0
 public void SetBarBorder(BorderCode bar)
 {
     base.SetBrcBar(bar);
 }
示例#19
0
 /**
  * Set the brc field for the CHP record.
  */
 public void SetBrc(BorderCode field_43_brc)
 {
     this.field_43_brc = field_43_brc;
 }
示例#20
0
文件: Paragraph.cs 项目: zzy092/npoi
 public void SetLeftBorder(BorderCode left)
 {
     _props.SetBrcLeft(left);
     _papx.UpdateSprm(SPRM_BRCLEFT, left.ToInt());
 }
示例#21
0
        public static String GetBorderType(BorderCode borderCode)
        {
            if (borderCode == null)
                throw new ArgumentNullException("borderCode is null");

            switch (borderCode.BorderType)
            {
                case 1:
                case 2:
                    return "solid";
                case 3:
                    return "double";
                case 5:
                    return "solid";
                case 6:
                    return "dotted";
                case 7:
                case 8:
                    return "dashed";
                case 9:
                    return "dotted";
                case 10:
                case 11:
                case 12:
                case 13:
                case 14:
                case 15:
                case 16:
                case 17:
                case 18:
                case 19:
                    return "double";
                case 20:
                    return "solid";
                case 21:
                    return "double";
                case 22:
                    return "dashed";
                case 23:
                    return "dashed";
                case 24:
                    return "ridge";
                case 25:
                    return "grooved";
                default:
                    return "solid";
            }
        }
示例#22
0
 /**
  * Set the brcVertical field for the TAP record.
  */
 public void SetBrcVertical(BorderCode field_15_brcVertical)
 {
     this.field_15_brcVertical = field_15_brcVertical;
 }
示例#23
0
        public static String GetBorderWidth(BorderCode borderCode)
        {
            int lineWidth = borderCode.LineWidth;
            int pt = lineWidth / 8;
            int pte = lineWidth - pt * 8;

            StringBuilder stringBuilder = new StringBuilder();
            stringBuilder.Append(pt);
            stringBuilder.Append(".");
            stringBuilder.Append(1000 / 8 * pte);
            stringBuilder.Append("pt");
            return stringBuilder.ToString();
        }
示例#24
0
 /**
  * Set the brcBetween field for the PAP record.
  */
 public void SetBrcBetween(BorderCode field_65_brcBetween)
 {
     this.field_65_brcBetween = field_65_brcBetween;
 }
示例#25
0
 /**
  * Set the brcLeft field for the TC record.
  */
 public void SetBrcLeft(BorderCode field_20_brcLeft)
 {
     this.field_20_brcLeft = field_20_brcLeft;
 }
示例#26
0
 protected PAPAbstractType()
 {
     this.field_11_lspd = new LineSpacingDescriptor();
     this.field_11_lspd = new LineSpacingDescriptor();
     this.field_28_dcs = new DropCapSpecifier();
     this.field_32_fWidowControl = true;
     this.field_41_lvl = 9;
     this.field_61_brcTop = new BorderCode();
     this.field_62_brcLeft = new BorderCode();
     this.field_63_brcBottom = new BorderCode();
     this.field_64_brcRight = new BorderCode();
     this.field_65_brcBetween = new BorderCode();
     this.field_66_brcBar = new BorderCode();
     this.field_67_shd = new ShadingDescriptor();
     this.field_68_anld = new byte[0];
     this.field_69_phe = new byte[0];
     this.field_72_dttmPropRMark = new DateAndTime();
     this.field_74_rgdxaTab = new int[0];
     this.field_75_rgtbd = new byte[0];
     this.field_76_numrm = new byte[0];
     this.field_77_ptap = new byte[0];
 }
示例#27
0
 /**
  * Set the brcRight field for the TC record.
  */
 public void SetBrcRight(BorderCode field_22_brcRight)
 {
     this.field_22_brcRight = field_22_brcRight;
 }
示例#28
0
        public override bool Equals(Object o)
        {
            BorderCode brc = (BorderCode)o;

            return(_info == brc._info && _info2 == brc._info2);
        }
示例#29
0
文件: Paragraph.cs 项目: zzy092/npoi
 public void SetRightBorder(BorderCode right)
 {
     _props.SetBrcRight(right);
     _papx.UpdateSprm(SPRM_BRCRIGHT, right.ToInt());
 }
示例#30
0
 /**
  * Set the brcTop field for the TC record.
  */
 public void SetBrcTop(BorderCode field_19_brcTop)
 {
     this.field_19_brcTop = field_19_brcTop;
 }
示例#31
0
文件: Paragraph.cs 项目: 89sos98/npoi
 public void SetTopBorder(BorderCode top)
 {
     _props.SetBrcTop(top);
     _papx.UpdateSprm(SPRM_BRCTOP, top.ToInt());
 }
示例#32
0
 /**
  * Set the brcBottom field for the TC record.
  */
 public void SetBrcBottom(BorderCode field_21_brcBottom)
 {
     this.field_21_brcBottom = field_21_brcBottom;
 }
示例#33
0
文件: Paragraph.cs 项目: 89sos98/npoi
 public void SetLeftBorder(BorderCode left)
 {
     _props.SetBrcLeft(left);
     _papx.UpdateSprm(SPRM_BRCLEFT, left.ToInt());
 }
示例#34
0
 public void SetBarBorder(BorderCode bar)
 {
     base.SetBrcBar(bar);
 }
示例#35
0
文件: Paragraph.cs 项目: 89sos98/npoi
 public void SetBottomBorder(BorderCode bottom)
 {
     _props.SetBrcBottom(bottom);
     _papx.UpdateSprm(SPRM_BRCBOTTOM, bottom.ToInt());
 }
示例#36
0
 public void SetLeftBorder(BorderCode left)
 {
     base.SetBrcLeft(left);
 }
示例#37
0
文件: Paragraph.cs 项目: 89sos98/npoi
 public void SetRightBorder(BorderCode right)
 {
     _props.SetBrcRight(right);
     _papx.UpdateSprm(SPRM_BRCRIGHT, right.ToInt());
 }
示例#38
0
 public void SetTopBorder(BorderCode top)
 {
     base.SetBrcTop(top);
 }
示例#39
0
文件: Paragraph.cs 项目: 89sos98/npoi
 public void SetBarBorder(BorderCode bar)
 {
     _props.SetBrcBar(bar);
     _papx.UpdateSprm(SPRM_BRCBAR, bar.ToInt());
 }
示例#40
0
        int _ico24 = -1; // default to -1 so we can ignore it for word 97 files

        public CharacterProperties()
        {
            field_17_fcPic = -1;
            field_22_dttmRMark = new DateAndTime();
            field_23_dttmRMarkDel = new DateAndTime();
            field_36_dttmPropRMark = new DateAndTime();
            field_40_dttmDispFldRMark = new DateAndTime();
            field_41_xstDispFldRMark = new byte[36];
            field_42_shd = new ShadingDescriptor();
            field_43_brc = new BorderCode();
            field_7_hps = 20;
            field_24_istd = 10;
            field_16_wCharScale = 100;
            field_13_lidDefault = 0x0400;
            field_14_lidFE = 0x0400;
        }
示例#41
0
文件: Paragraph.cs 项目: zzy092/npoi
 public void SetTopBorder(BorderCode top)
 {
     _props.SetBrcTop(top);
     _papx.UpdateSprm(SPRM_BRCTOP, top.ToInt());
 }