当前位置: 首页>>代码示例>>C#>>正文


C# List.IsNumbered方法代码示例

本文整理汇总了C#中iTextSharp.text.List.IsNumbered方法的典型用法代码示例。如果您正苦于以下问题:C# List.IsNumbered方法的具体用法?C# List.IsNumbered怎么用?C# List.IsNumbered使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在iTextSharp.text.List的用法示例。


在下文中一共展示了List.IsNumbered方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: RtfList

        /**
        * Constructs a new RtfList for the specified List.
        *
        * @param doc The RtfDocument this RtfList belongs to
        * @param list The List this RtfList is based on
        */
        public RtfList(RtfDocument doc, List list)
            : base(doc)
        {
            this.listNumber = document.GetDocumentHeader().GetListNumber(this);

            this.items = new ArrayList();
            if (list.SymbolIndent > 0 && list.IndentationLeft > 0) {
                this.firstIndent = (int) (list.SymbolIndent * RtfElement.TWIPS_FACTOR * -1);
                this.leftIndent = (int) ((list.IndentationLeft + list.SymbolIndent) * RtfElement.TWIPS_FACTOR);
            } else if (list.SymbolIndent > 0) {
                this.firstIndent = (int) (list.SymbolIndent * RtfElement.TWIPS_FACTOR * -1);
                this.leftIndent = (int) (list.SymbolIndent * RtfElement.TWIPS_FACTOR);
            } else if (list.IndentationLeft > 0) {
                this.firstIndent = 0;
                this.leftIndent = (int) (list.IndentationLeft * RtfElement.TWIPS_FACTOR);
            } else {
                this.firstIndent = 0;
                this.leftIndent = 0;
            }
            this.rightIndent = (int) (list.IndentationRight * RtfElement.TWIPS_FACTOR);
            this.symbolIndent = (int) ((list.SymbolIndent + list.IndentationLeft) * RtfElement.TWIPS_FACTOR);
            this.numbered = list.IsNumbered();

            for (int i = 0; i < list.Items.Count; i++) {
                try {
                    IElement element = (IElement) list.Items[i];
                    if (element.Type == Element.CHUNK) {
                        element = new ListItem((Chunk) element);
                    }
                    if (element is ListItem) {
                        this.alignment = ((ListItem) element).Alignment;
                    }
                    IRtfBasicElement rtfElement = doc.GetMapper().MapElement(element);
                    if (rtfElement is RtfList) {
                        ((RtfList) rtfElement).SetListNumber(listNumber);
                        ((RtfList) rtfElement).SetListLevel(listLevel + 1);
                        ((RtfList) rtfElement).SetParent(this);
                    } else if (rtfElement is RtfListItem) {
                        ((RtfListItem) rtfElement).SetParent(this);
                        ((RtfListItem) rtfElement).InheritListSettings(listNumber, listLevel + 1);
                    }
                    items.Add(rtfElement);
                } catch (DocumentException ) {
                }
            }
            if (this.listLevel == 0) {
                CorrectIndentation();
            }

            fontNumber = new ST.RtfFont(document, new Font(Font.TIMES_ROMAN, 10, Font.NORMAL, new Color(0, 0, 0)));
            fontBullet = new ST.RtfFont(document, new Font(Font.SYMBOL, 10, Font.NORMAL, new Color(0, 0, 0)));
        }
开发者ID:hjgode,项目名称:iTextSharpCF,代码行数:58,代码来源:RtfList.cs

示例2: WriteList

 /**
 * Write a <code>List</code>
 *
 * @param list The <code>List</code> to be written
 * @param outp The <code>MemoryStream</code> to write to
 *
 * @throws    IOException
 * @throws    DocumentException
 */
 private void WriteList(List list, MemoryStream outp)
 {
     int type = 0;
     int align = 0;
     int fontNr = AddFont(new Font(Font.SYMBOL, 10, Font.NORMAL, new Color(0, 0, 0)));
     if (!list.IsNumbered()) type = 23;
     if (listLevel == 0) {
         maxListLevel = 0;
         listtable.WriteByte(openGroup);
         listtable.WriteByte(escape);
         listtable.Write(listDefinition, 0, listDefinition.Length);
         int i = GetRandomInt();
         listtable.WriteByte(escape);
         listtable.Write(listTemplateID, 0, listTemplateID.Length);
         WriteInt(listtable, i);
         listtable.WriteByte(escape);
         listtable.Write(hybridList, 0, hybridList.Length);
         listtable.WriteByte((byte) '\n');
     }
     if (listLevel >= maxListLevel) {
         maxListLevel++;
         listtable.WriteByte(openGroup);
         listtable.WriteByte(escape);
         listtable.Write(listLevelDefinition, 0, listLevelDefinition.Length);
         listtable.WriteByte(escape);
         listtable.Write(listLevelTypeOld, 0, listLevelTypeOld.Length);
         WriteInt(listtable, type);
         listtable.WriteByte(escape);
         listtable.Write(listLevelTypeNew, 0, listLevelTypeNew.Length);
         WriteInt(listtable, type);
         listtable.WriteByte(escape);
         listtable.Write(listLevelAlignOld, 0, listLevelAlignOld.Length);
         WriteInt(listtable, align);
         listtable.WriteByte(escape);
         listtable.Write(listLevelAlignNew, 0, listLevelAlignNew.Length);
         WriteInt(listtable, align);
         listtable.WriteByte(escape);
         listtable.Write(listLevelStartAt, 0, listLevelStartAt.Length);
         WriteInt(listtable, 1);
         listtable.WriteByte(openGroup);
         listtable.WriteByte(escape);
         listtable.Write(listLevelTextDefinition, 0, listLevelTextDefinition.Length);
         listtable.WriteByte(escape);
         listtable.Write(listLevelTextLength, 0, listLevelTextLength.Length);
         if (list.IsNumbered()) {
             WriteInt(listtable, 2);
         } else {
             WriteInt(listtable, 1);
         }
         listtable.WriteByte(escape);
         if (list.IsNumbered()) {
             listtable.Write(listLevelTextStyleNumbers, 0, listLevelTextStyleNumbers.Length);
         } else {
             listtable.Write(listLevelTextStyleBullet, 0, listLevelTextStyleBullet.Length);
         }
         listtable.WriteByte(commaDelimiter);
         listtable.WriteByte(closeGroup);
         listtable.WriteByte(openGroup);
         listtable.WriteByte(escape);
         listtable.Write(listLevelNumbersDefinition, 0, listLevelNumbersDefinition.Length);
         if (list.IsNumbered()) {
             listtable.WriteByte(delimiter);
             listtable.Write(listLevelNumbers, 0, listLevelNumbers.Length);
             WriteInt(listtable, listLevel + 1);
         }
         listtable.WriteByte(commaDelimiter);
         listtable.WriteByte(closeGroup);
         if (!list.IsNumbered()) {
             listtable.WriteByte(escape);
             listtable.WriteByte(fontNumber);
             WriteInt(listtable, fontNr);
         }
         listtable.WriteByte(escape);
         listtable.Write(firstIndent, 0, firstIndent.Length);
         WriteInt(listtable, (int) (list.IndentationLeft * TWIPSFACTOR * -1));
         listtable.WriteByte(escape);
         listtable.Write(listIndent, 0, listIndent.Length);
         WriteInt(listtable, (int) ((list.IndentationLeft + list.SymbolIndent) * TWIPSFACTOR));
         listtable.WriteByte(escape);
         listtable.Write(rightIndent, 0, rightIndent.Length);
         WriteInt(listtable, (int) (list.IndentationRight * TWIPSFACTOR));
         listtable.WriteByte(escape);
         listtable.Write(tabStop, 0, tabStop.Length);
         WriteInt(listtable, (int) (list.SymbolIndent * TWIPSFACTOR));
         listtable.WriteByte(closeGroup);
         listtable.WriteByte((byte) '\n');
     }
     // Actual List Begin in Content
     outp.WriteByte(escape);
     outp.Write(paragraphDefaults, 0, paragraphDefaults.Length);
     outp.WriteByte(escape);
//.........这里部分代码省略.........
开发者ID:hjgode,项目名称:iTextSharpCF,代码行数:101,代码来源:RtfWriter.cs


注:本文中的iTextSharp.text.List.IsNumbered方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。