当前位置: 首页>>代码示例>>C#>>正文


C# Parse.text方法代码示例

本文整理汇总了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);
     }
 }
开发者ID:juherr,项目名称:fit,代码行数:12,代码来源:ActionFixture.cs

示例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);
     }
 }
开发者ID:juherr,项目名称:fit,代码行数:12,代码来源:Realtime.cs

示例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);
     }
 }
开发者ID:juherr,项目名称:fit,代码行数:22,代码来源:ColumnFixture.cs

示例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);
         }
     }
 }
开发者ID:juherr,项目名称:fit,代码行数:23,代码来源:ColumnFixture.cs

示例5: testText

    public void testText()
    {
        string[] tags ={"td"};
        Parse p = new Parse("<td>a&lt;b</td>", tags);
        Assert.AreEqual("a&lt;b", p.body);
        Assert.AreEqual("a<b", p.text());
        p = new Parse("<td>\ta&gt;b&nbsp;&amp;&nbsp;b>c &&&lt;</td>", tags);
        Assert.AreEqual("a>b & b>c &&<", p.text());
        p = new Parse("<td>\ta&gt;b&nbsp;&amp;&nbsp;b>c &&lt;</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("&nbsp;"));
        Assert.AreEqual("a b", Parse.htmlToText("a <tag /> b"));
        Assert.AreEqual("a", Parse.htmlToText("a &nbsp;"));
        Assert.AreEqual("a", Parse.htmlToText("\u00a0 a \u00a0"));
        Assert.AreEqual("&nbsp;", Parse.htmlToText("&amp;nbsp;"));
        Assert.AreEqual("1     2", Parse.htmlToText("1 &nbsp; &nbsp; 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"));
    }
开发者ID:juherr,项目名称:fit,代码行数:31,代码来源:ParseTest.cs

示例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);
         }
     }
 }
开发者ID:juherr,项目名称:fit,代码行数:40,代码来源:Fixture.cs

示例7: wrong

 public virtual void wrong(Parse cell)
 {
     cell.addToTag(" bgcolor=\"" + red + "\"");
     cell.body = escape(cell.text());
     counts.wrong++;
 }
开发者ID:juherr,项目名称:fit,代码行数:6,代码来源:Fixture.cs

示例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++;
 }
开发者ID:juherr,项目名称:fit,代码行数:7,代码来源:Fixture.cs


注:本文中的fit.Parse.text方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。