Esempio n. 1
0
 private TextTagTable CreateTextTagTable(XmlNode topLevelNode)
 {
     TextTagTable textTagTable = new TextTagTable();
        TextTag smallFontTag = new TextTag("small-font");
        smallFontTag.Scale = Pango.Scale.Small;
        textTagTable.Add(smallFontTag);
        XmlNodeList linkNodes = topLevelNode.SelectNodes("//a");
        if (linkNodes != null)
        {
     foreach(XmlNode linkNode in linkNodes)
     {
      XmlAttribute href = linkNode.Attributes["href"];
      if (href != null)
      {
       string textTagName = href.Value;
       if (textTagTable.Lookup(textTagName) != null)
        continue;
       TextTag textTag = new TextTag(textTagName);
       textTag.Underline = Pango.Underline.Single;
       textTag.Foreground = "blue";
       textTag.TextEvent +=
        new TextEventHandler(OnTextEvent);
       textTagTable.Add(textTag);
      }
     }
        }
        return textTagTable;
 }