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


C# Chunk.IsEmpty方法代码示例

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


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

示例1: AddChunk

     /// <summary>
     /// Adds a Chunk.
     /// </summary>
     /// <remarks>
     /// This method is a hack to solve a problem I had with phrases that were split between chunks
     /// in the wrong place.
     /// </remarks>
     /// <param name="chunk">a Chunk</param>
     /// <returns>a bool</returns>
     protected bool AddChunk(Chunk chunk) {
 	    Font f = chunk.Font;
 	    String c = chunk.Content;
         if (font != null && !font.IsStandardFont()) {
             f = font.Difference(chunk.Font);
         }
         if (Count > 0 && !chunk.HasAttributes()) {
             try {
                 Chunk previous = (Chunk) this[Count - 1];
                 if (!previous.HasAttributes()
                         && (f == null
                         || f.CompareTo(previous.Font) == 0)
                         && previous.Font.CompareTo(f) == 0
                         && !"".Equals(previous.Content.Trim())
                         && !"".Equals(c.Trim())) {
                     previous.Append(c);
                     return true;
                 }
             }
             catch {
             }
         }
         Chunk newChunk = new Chunk(c, f);
         newChunk.Attributes = chunk.Attributes;
         if (hyphenation != null && newChunk.GetHyphenation() == null && !newChunk.IsEmpty()) {
             newChunk.SetHyphenation(hyphenation);
         }
         base.Add(newChunk);
         return true;
     }
开发者ID:pusp,项目名称:o2platform,代码行数:39,代码来源:Phrase.cs

示例2: ApplyAnchor

 /**
  * Applies the properties of the Anchor to a Chunk.
  * @param chunk			the Chunk (part of the Anchor)
  * @param notGotoOK		if true, this chunk will determine the local destination
  * @param localDestination	true if the chunk is a local goto and the reference a local destination
  * @return	the value of notGotoOK or false, if a previous Chunk was used to determine the local destination
  */
 protected bool ApplyAnchor(Chunk chunk, bool notGotoOK, bool localDestination) {
     if (name != null && notGotoOK && !chunk.IsEmpty()) {
         chunk.SetLocalDestination(name);
         notGotoOK = false;
     }
     if (localDestination) {
         chunk.SetLocalGoto(reference.Substring(1));
     } else if (reference != null)
         chunk.SetAnchor(reference);
     return notGotoOK;
 }
开发者ID:,项目名称:,代码行数:18,代码来源:


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