當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。