Пример #1
0
 public void error(Parse cell, String message)
 {
     cell.body = escape(cell.text());
     cell.addToBody("<hr><pre>" + escape(message) + "</pre>");
     cell.addToTag(" bgcolor=\"" + yellow + "\"");
     counts.exceptions++;
 }
Пример #2
0
        protected virtual Parse buildCells(object row)
        {
            if (row == null)
            {
                Parse nil = new Parse("td", "null", null, null);
                nil.addToTag(" colspan=" + columnBindings.Length);
                return(nil);
            }
            Parse root = new Parse(null, null, null, null);
            Parse next = root;

            for (int i = 0; i < columnBindings.Length; i++)
            {
                next = next.more = new Parse("td", "&nbsp;", null, null);
                TypeAdapter a = columnBindings[i];
                if (a == null)
                {
                    ignore(next);
                }
                else
                {
                    try {
                        a.target = row;
                        info(next, a.get().ToString());
                    }
                    catch (Exception e) {
                        exception(next, e);
                    }
                }
            }
            return(root.more);
        }
Пример #3
0
        public String ResultingHTML()
        {
            Parse table = new Parse(OriginalHTML);
            Parse row = table.at(0, Row - 1);
            Parse cell = row.at(0, Column - 1);

            if (OverwriteCellBody != null) cell.body = OverwriteCellBody;
            if (AddToCellBody != null) cell.addToBody(AddToCellBody);

            if (OverwriteCellTag != null) cell.tag = OverwriteCellTag;
            if (OverwriteEndCellTag != null) cell.end = OverwriteEndCellTag;
            if (AddToCellTag != null) cell.addToTag(stripDelimiters(AddToCellTag));

            if (OverwriteRowTag != null) row.tag = OverwriteRowTag;
            if (OverwriteEndRowTag != null) row.end = OverwriteEndRowTag;
            if (AddToRowTag != null) row.addToTag(stripDelimiters(AddToRowTag));

            if (OverwriteTableTag != null) table.tag = OverwriteTableTag;
            if (OverwriteEndTableTag != null) table.end = OverwriteEndTableTag;
            if (AddToTableTag != null) table.addToTag(stripDelimiters(AddToTableTag));

            if (AddCellFollowing != null) addParse(cell, AddCellFollowing, new String[] {"td"});
            if (RemoveFollowingCell != null) removeParse(cell);

            if (AddRowFollowing != null) addParse(row, AddRowFollowing, new String[] {"tr", "td"});
            if (RemoveFollowingRow != null) removeParse(row);

            if (AddTableFollowing != null) addParse(table, AddTableFollowing, new String[] {"table", "tr", "td"});

            return GenerateOutput(table);
        }
Пример #4
0
 public virtual void ignore(Parse cell)
 {
     cell.addToTag(" bgcolor=\"#efefef\"");
     counts.ignores++;
 }
Пример #5
0
 public virtual void wrong(Parse cell)
 {
     cell.addToTag(" bgcolor=\"" + red + "\"");
     cell.body = escape(cell.text());
     counts.wrong++;
 }
Пример #6
0
 public virtual void right(Parse cell)
 {
     cell.addToTag(" bgcolor=\"" + green + "\"");
     counts.right++;
 }
Пример #7
0
 public virtual void wrong(Parse cell)
 {
     cell.addToTag(" bgcolor=\"" + red + "\"");
     cell.body = escape(cell.text());
     counts.wrong++;
 }
Пример #8
0
 public virtual void right(Parse cell)
 {
     cell.addToTag(" bgcolor=\"" + green + "\"");
     counts.right++;
 }
Пример #9
0
 public virtual void ignore(Parse cell)
 {
     cell.addToTag(" bgcolor=\"#efefef\"");
     counts.ignores++;
 }
Пример #10
0
 public void error(Parse cell, String message)
 {
     cell.body = escape(cell.text());
     cell.addToBody("<hr><pre>" + escape(message) + "</pre>");
     cell.addToTag(" bgcolor=\"" + yellow + "\"");
     counts.exceptions++;
 }
Пример #11
0
 protected virtual Parse buildCells(object row)
 {
     if (row == null) {
         Parse nil = new Parse("td", "null", null, null);
         nil.addToTag(" colspan="+columnBindings.Length);
         return nil;
     }
     Parse root = new Parse(null, null, null, null);
     Parse next = root;
     for (int i=0; i<columnBindings.Length; i++) {
         next = next.more = new Parse("td", "&nbsp;", null, null);
         TypeAdapter a = columnBindings[i];
         if (a == null) {
             ignore (next);
         }
         else {
             try {
                 a.target = row;
                 info(next, a.get().ToString());
             }
             catch (Exception e) {
                 exception(next, e);
             }
         }
     }
     return root.more;
 }