當前位置: 首頁>>代碼示例>>C#>>正文


C# XMLToken.getAttributes方法代碼示例

本文整理匯總了C#中libsbmlcs.XMLToken.getAttributes方法的典型用法代碼示例。如果您正苦於以下問題:C# XMLToken.getAttributes方法的具體用法?C# XMLToken.getAttributes怎麽用?C# XMLToken.getAttributes使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在libsbmlcs.XMLToken的用法示例。


在下文中一共展示了XMLToken.getAttributes方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: test_XMLToken_newSetters_removeAttributes1

 public void test_XMLToken_newSetters_removeAttributes1()
 {
     XMLTriple triple = new  XMLTriple("test","","");
       XMLAttributes attr = new  XMLAttributes();
       XMLToken token = new  XMLToken(triple,attr);
       XMLTriple xt2 = new  XMLTriple("name3",  "http://name3.org/", "p3");
       XMLTriple xt1 = new  XMLTriple("name5",  "http://name5.org/", "p5");
       int i = token.addAttr( "name1", "val1");
       i = token.addAttr( "name2", "val2",  "http://name1.org/", "p1");
       i = token.addAttr(xt2, "val2");
       i = token.addAttr( "name4", "val4");
       assertTrue( token.getAttributes().getLength() == 4 );
       i = token.removeAttr(7);
       assertTrue( i == libsbml.LIBSBML_INDEX_EXCEEDS_SIZE );
       i = token.removeAttr( "name7");
       assertTrue( i == libsbml.LIBSBML_INDEX_EXCEEDS_SIZE );
       i = token.removeAttr( "name7", "namespaces7");
       assertTrue( i == libsbml.LIBSBML_INDEX_EXCEEDS_SIZE );
       i = token.removeAttr(xt1);
       assertTrue( i == libsbml.LIBSBML_INDEX_EXCEEDS_SIZE );
       assertTrue( token.getAttributes().getLength() == 4 );
       i = token.removeAttr(3);
       assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
       assertTrue( token.getAttributes().getLength() == 3 );
       i = token.removeAttr( "name1");
       assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
       assertTrue( token.getAttributes().getLength() == 2 );
       i = token.removeAttr( "name2", "http://name1.org/");
       assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
       assertTrue( token.getAttributes().getLength() == 1 );
       i = token.removeAttr(xt2);
       assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
       assertTrue( token.getAttributes().getLength() == 0 );
       xt1 = null;
       xt2 = null;
       triple = null;
       attr = null;
       token = null;
 }
開發者ID:yarden,項目名稱:roadrunner,代碼行數:39,代碼來源:TestXMLToken_newSetters.cs

示例2: test_XMLToken_create

 public void test_XMLToken_create()
 {
     XMLToken token;
       XMLTriple triple;
       XMLAttributes attr;
       token = new  XMLToken();
       assertTrue( token != null );
       token = null;
       triple = new  XMLTriple("attr", "uri", "prefix");
       token = new  XMLToken(triple);
       assertTrue( token != null );
       assertTrue( (  "attr" != token.getName() ) == false );
       assertTrue( (  "prefix" != token.getPrefix() ) == false );
       assertTrue( (  "uri" != token.getURI() ) == false );
       token = null;
       attr = new  XMLAttributes();
       assertTrue( attr != null );
       attr.add( "attr2", "value");
       token = new  XMLToken(triple,attr);
       assertTrue( token != null );
       XMLAttributes returnattr = token.getAttributes();
       assertTrue( (  "attr2" != returnattr.getName(0) ) == false );
       token = null;
       triple = null;
       attr = null;
 }
開發者ID:0u812,項目名稱:roadrunner-backup,代碼行數:26,代碼來源:TestXMLToken.cs


注:本文中的libsbmlcs.XMLToken.getAttributes方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。