本文整理汇总了C#中Chunk.SetGenericTag方法的典型用法代码示例。如果您正苦于以下问题:C# Chunk.SetGenericTag方法的具体用法?C# Chunk.SetGenericTag怎么用?C# Chunk.SetGenericTag使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Chunk
的用法示例。
在下文中一共展示了Chunk.SetGenericTag方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Create
/**
* Create an index entry.
*
* @param text The text for the Chunk.
* @param in1 The first level.
* @param in2 The second level.
* @param in3 The third level.
* @return Returns the Chunk.
*/
public Chunk Create(String text, String in1, String in2,
String in3)
{
Chunk chunk = new Chunk(text);
String tag = "idx_" + (indexcounter++);
chunk.SetGenericTag(tag);
chunk.SetLocalDestination(tag);
Entry entry = new Entry(in1, in2, in3, tag, this);
indexentry.Add(entry);
return chunk;
}
示例2: GetPhrase
public static Phrase GetPhrase(Properties attributes)
{
Phrase phrase = new Phrase();
phrase.Font = FontFactory.GetFont(attributes);
String value;
value = attributes[ElementTags.LEADING];
if (value != null) {
phrase.Leading = float.Parse(value, NumberFormatInfo.InvariantInfo);
}
value = attributes[Markup.CSS_KEY_LINEHEIGHT];
if (value != null) {
phrase.Leading = Markup.ParseLength(value, Markup.DEFAULT_FONT_SIZE);
}
value = attributes[ElementTags.ITEXT];
if (value != null) {
Chunk chunk = new Chunk(value);
if ((value = attributes[ElementTags.GENERICTAG]) != null) {
chunk.SetGenericTag(value);
}
phrase.Add(chunk);
}
return phrase;
}
示例3: GetChunk
public static Chunk GetChunk(Properties attributes)
{
Chunk chunk = new Chunk();
chunk.Font = FontFactory.GetFont(attributes);
String value;
value = attributes[ElementTags.ITEXT];
if (value != null) {
chunk.Append(value);
}
value = attributes[ElementTags.LOCALGOTO];
if (value != null) {
chunk.SetLocalGoto(value);
}
value = attributes[ElementTags.REMOTEGOTO];
if (value != null) {
String page = attributes[ElementTags.PAGE];
if (page != null) {
chunk.SetRemoteGoto(value, int.Parse(page));
}
else {
String destination = attributes[ElementTags.DESTINATION];
if (destination != null) {
chunk.SetRemoteGoto(value, destination);
}
}
}
value = attributes[ElementTags.LOCALDESTINATION];
if (value != null) {
chunk.SetLocalDestination(value);
}
value = attributes[ElementTags.SUBSUPSCRIPT];
if (value != null) {
chunk.SetTextRise(float.Parse(value, NumberFormatInfo.InvariantInfo));
}
value = attributes[Markup.CSS_KEY_VERTICALALIGN];
if (value != null && value.EndsWith("%")) {
float p = float.Parse(value.Substring(0, value.Length - 1), NumberFormatInfo.InvariantInfo) / 100f;
chunk.SetTextRise(p * chunk.Font.Size);
}
value = attributes[ElementTags.GENERICTAG];
if (value != null) {
chunk.SetGenericTag(value);
}
value = attributes[ElementTags.BACKGROUNDCOLOR];
if (value != null) {
chunk.SetBackground(Markup.DecodeColor(value));
}
return chunk;
}