Ejemplo n.º 1
0
 /// <summary>
 /// Returns true if the reader is positioned on a node that has a bgColor="#ff99cb" attribute.
 /// </summary>
 private static bool IsBgColorFF99CB(HtmlTextReader reader)
 {
     if (reader.HasAttributes)
     {
         for (int i = 0; i < reader.AttributeCount; i++)
         {
             if (String.Compare("bgColor", reader.GetAttributeName(i), StringComparison.OrdinalIgnoreCase) == 0 &&
                 String.Compare("#ff99cb", reader.GetAttributeValue(i).ToString(), StringComparison.OrdinalIgnoreCase) == 0)
             {
                 return(true);
             }
         }
     }
     return(false);
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Returns true if the reader is positioned on an assessment item IMG tag and sets srcIndex to the index of the
 /// src attribute.
 /// </summary>
 private static bool IsAITag(HtmlTextReader reader, out int srcIndex)
 {
     if (reader.NodeType == HtmlNodeType.Element &&
         String.Compare(reader.Name, "img", StringComparison.OrdinalIgnoreCase) == 0)
     {
         if (reader.HasAttributes)
         {
             for (int i = 0; i < reader.AttributeCount; i++)
             {
                 if (String.Compare("src", reader.GetAttributeName(i), StringComparison.OrdinalIgnoreCase) == 0 &&
                     reader.GetAttributeValue(i).ToString().Contains("mslamrk"))
                 {
                     srcIndex = i;
                     return(true);
                 }
             }
         }
     }
     srcIndex = -1;
     return(false);
 }