本文整理汇总了C#中NPOI.OpenXmlFormats.Spreadsheet.CT_Font.AddNewI方法的典型用法代码示例。如果您正苦于以下问题:C# CT_Font.AddNewI方法的具体用法?C# CT_Font.AddNewI怎么用?C# CT_Font.AddNewI使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NPOI.OpenXmlFormats.Spreadsheet.CT_Font
的用法示例。
在下文中一共展示了CT_Font.AddNewI方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestItalic
public void TestItalic()
{
CT_Font ctFont = new CT_Font();
CT_BooleanProperty bool1 = ctFont.AddNewI();
bool1.val = (false);
ctFont.SetIArray(0, bool1);
XSSFFont xssfFont = new XSSFFont(ctFont);
Assert.AreEqual(false, xssfFont.IsItalic);
xssfFont.IsItalic = (true);
Assert.AreEqual(1,ctFont.i.Count);
Assert.AreEqual(true, ctFont.GetIArray(0).val);
Assert.AreEqual(true, ctFont.GetIArray(0).val);
}
示例2: ToCTFont
/**
*
* CTRPrElt --> CTFont adapter
*/
protected static CT_Font ToCTFont(CT_RPrElt pr)
{
CT_Font ctFont = new CT_Font();
if (pr.sizeOfBArray() > 0) ctFont.AddNewB().val = (pr.GetBArray(0).val);
if (pr.sizeOfUArray() > 0) ctFont.AddNewU().val = (pr.GetUArray(0).val);
if (pr.sizeOfIArray() > 0) ctFont.AddNewI().val = (pr.GetIArray(0).val);
if (pr.sizeOfColorArray() > 0)
{
CT_Color c1 = pr.GetColorArray(0);
CT_Color c2 = ctFont.AddNewColor();
if (c1.IsSetAuto())
{
c2.auto = (c1.auto);
c2.autoSpecified = true;
}
if (c1.IsSetIndexed())
{
c2.indexed = (c1.indexed);
c2.indexedSpecified = true;
}
if (c1.IsSetRgb())
{
c2.SetRgb(c1.GetRgb());
c2.rgbSpecified = true;
}
if (c1.IsSetTheme())
{
c2.theme = (c1.theme);
c2.themeSpecified = true;
}
if (c1.IsSetTint())
{
c2.tint = (c1.tint);
c2.tintSpecified = true;
}
}
if (pr.sizeOfSzArray() > 0) ctFont.AddNewSz().val = (pr.GetSzArray(0).val);
if (pr.sizeOfRFontArray() > 0) ctFont.AddNewName().val = (pr.GetRFontArray(0).val);
if (pr.sizeOfFamilyArray() > 0) ctFont.AddNewFamily().val = (pr.GetFamilyArray(0).val);
if (pr.sizeOfSchemeArray() > 0) ctFont.AddNewScheme().val = (pr.GetSchemeArray(0).val);
if (pr.sizeOfCharsetArray() > 0) ctFont.AddNewCharset().val = (pr.GetCharsetArray(0).val);
if (pr.sizeOfCondenseArray() > 0) ctFont.AddNewCondense().val = (pr.GetCondenseArray(0).val);
if (pr.sizeOfExtendArray() > 0) ctFont.AddNewExtend().val = (pr.GetExtendArray(0).val);
if (pr.sizeOfVertAlignArray() > 0) ctFont.AddNewVertAlign().val = (pr.GetVertAlignArray(0).val);
if (pr.sizeOfOutlineArray() > 0) ctFont.AddNewOutline().val = (pr.GetOutlineArray(0).val);
if (pr.sizeOfShadowArray() > 0) ctFont.AddNewShadow().val = (pr.GetShadowArray(0).val);
if (pr.sizeOfStrikeArray() > 0) ctFont.AddNewStrike().val = (pr.GetStrikeArray(0).val);
return ctFont;
}
示例3: Clone
public CT_Font Clone()
{
CT_Font ctFont = new CT_Font();
if (this.name.Count != 0)
{
CT_FontName newName = ctFont.AddNewName();
newName.val = this.GetNameArray(0).val;
}
if (this.charset.Count != 0)
{
CT_IntProperty newCharset = ctFont.AddNewCharset();
newCharset.val = this.GetCharsetArray(0).val;
}
if (this.family.Count != 0)
{
CT_IntProperty newFamily = ctFont.AddNewFamily();
newFamily.val = this.GetFamilyArray(0).val;
}
if (this.b.Count != 0)
{
CT_BooleanProperty newB = ctFont.AddNewB();
newB.val = this.GetBArray(0).val;
}
if (this.i.Count != 0)
{
CT_BooleanProperty newI = ctFont.AddNewI();
newI.val = this.GetIArray(0).val;
}
if (this.strike.Count != 0)
{
CT_BooleanProperty newstrike = ctFont.AddNewStrike();
newstrike.val = this.GetStrikeArray(0).val;
}
if (this.outline != null)
{
ctFont.outline = new CT_BooleanProperty();
ctFont.outline.val = this.outline.val;
}
if (this.shadow != null)
{
ctFont.shadow = new CT_BooleanProperty();
ctFont.shadow.val = this.shadow.val;
}
if (this.condense != null)
{
ctFont.condense = new CT_BooleanProperty();
ctFont.condense.val = this.condense.val;
}
if (this.extend != null)
{
ctFont.extend = new CT_BooleanProperty();
ctFont.extend.val = this.extend.val;
}
if (this.color.Count != 0)
{
CT_Color newColor = ctFont.AddNewColor();
newColor.theme = this.GetColorArray(0).theme;
}
if (this.sz.Count != 0)
{
CT_FontSize newSz = ctFont.AddNewSz();
newSz.val = this.GetSzArray(0).val;
}
if (this.u.Count != 0)
{
CT_UnderlineProperty newU = ctFont.AddNewU();
newU.val = this.GetUArray(0).val;
}
if (this.vertAlign.Count != 0)
{
CT_VerticalAlignFontProperty newVertAlign = ctFont.AddNewVertAlign();
newVertAlign.val = this.GetVertAlignArray(0).val;
}
if (this.scheme.Count != 0)
{
CT_FontScheme newFs = ctFont.AddNewScheme();
newFs.val = this.GetSchemeArray(0).val;
}
return ctFont;
}