本文整理汇总了C#中fit.Parse.text方法的典型用法代码示例。如果您正苦于以下问题:C# Parse.text方法的具体用法?C# Parse.text怎么用?C# Parse.text使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类fit.Parse
的用法示例。
在下文中一共展示了Parse.text方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: doCells
// Traversal ////////////////////////////////
public override void doCells(Parse cells)
{
this.cells = cells;
try {
MethodInfo action = GetType().GetMethod(cells.text(), new Type[] {});
action.Invoke(this, new Type[] {});
}
catch (Exception e) {
exception(cells, e);
}
}
示例2: systemMethod
private void systemMethod(string prefix, Parse cell)
{
string method = camel(prefix+" "+cell.text());
Type[] empty = {};
try {
BindingFlags searchFlags = BindingFlags.IgnoreCase | BindingFlags.Instance | BindingFlags.Public;
MethodInfo methodInfo = system.GetType().GetMethod(method, searchFlags, null, empty, null);
methodInfo.Invoke(system,empty);
} catch (Exception e) {
exception (cell, e);
}
}
示例3: doCell
public override void doCell(Parse cell, int column)
{
TypeAdapter a = columnBindings[column];
try {
string text = cell.text();
if (text == "") {
check(cell, a);
}
else if (a == null) {
ignore(cell);
}
else if (a.field != null) {
a.set(a.parse(text));
}
else if (a.method != null) {
check(cell, a);
}
}
catch(Exception e) {
exception(cell, e);
}
}
示例4: bind
// Utility //////////////////////////////////
protected virtual void bind(Parse heads)
{
columnBindings = new TypeAdapter[heads.size()];
for (int i=0; heads!=null; i++, heads=heads.more) {
String name = heads.text();
String suffix = "()";
try {
if (name == "") {
columnBindings[i] = null;
}
else if (name.EndsWith(suffix)) {
columnBindings[i] = bindMethod(name.Substring(0,name.Length-suffix.Length));
}
else {
columnBindings[i] = bindField(name);
}
}
catch (Exception e) {
exception (heads, e);
}
}
}
示例5: testText
public void testText()
{
string[] tags ={"td"};
Parse p = new Parse("<td>a<b</td>", tags);
Assert.AreEqual("a<b", p.body);
Assert.AreEqual("a<b", p.text());
p = new Parse("<td>\ta>b & b>c &&<</td>", tags);
Assert.AreEqual("a>b & b>c &&<", p.text());
p = new Parse("<td>\ta>b & b>c &<</td>", tags);
Assert.AreEqual("a>b & b>c &<", p.text());
p = new Parse("<TD><P><FONT FACE=\"Arial\" SIZE=2>GroupTestFixture</FONT></TD>", tags);
Assert.AreEqual("GroupTestFixture",p.text());
Assert.AreEqual("", Parse.htmlToText(" "));
Assert.AreEqual("a b", Parse.htmlToText("a <tag /> b"));
Assert.AreEqual("a", Parse.htmlToText("a "));
Assert.AreEqual("a", Parse.htmlToText("\u00a0 a \u00a0"));
Assert.AreEqual(" ", Parse.htmlToText("&nbsp;"));
Assert.AreEqual("1 2", Parse.htmlToText("1 2"));
Assert.AreEqual("1 2", Parse.htmlToText("1 \u00a0\u00a0\u00a0\u00a02"));
Assert.AreEqual("a", Parse.htmlToText(" <tag />a"));
Assert.AreEqual("a\nb", Parse.htmlToText("a<br />b"));
Assert.AreEqual("ab", Parse.htmlToText("<font size=+1>a</font>b"));
Assert.AreEqual("ab", Parse.htmlToText("a<font size=+1>b</font>"));
Assert.AreEqual("a<b", Parse.htmlToText("a<b"));
Assert.AreEqual("a\nb\nc\nd", Parse.htmlToText("a<br>b<br/>c< br / >d"));
Assert.AreEqual("a\nb", Parse.htmlToText("a</p><p>b"));
Assert.AreEqual("a\nb", Parse.htmlToText("a< / p > < p >b"));
}
示例6: check
public virtual void check(Parse cell, TypeAdapter a)
{
string text = cell.text();
if (text == "") {
try {
info(cell, a.ToString(a.get()));
}
catch (Exception) {
info(cell, "error");
}
}
else if (a == null) {
ignore(cell);
}
else if (text == "error") {
try {
wrong(cell, a.ToString(a.get()));
}
catch (MethodAccessException e) {
exception (cell, e);
}
catch (Exception) {
right(cell);
}
}
else {
try {
object result = a.get();
if (a.equals(a.parse(text), result)) {
right(cell);
}
else {
wrong(cell, a.ToString(a.get()));
}
}
catch (Exception e) {
exception(cell, e);
}
}
}
示例7: wrong
public virtual void wrong(Parse cell)
{
cell.addToTag(" bgcolor=\"" + red + "\"");
cell.body = escape(cell.text());
counts.wrong++;
}
示例8: error
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++;
}