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


C# XMLNode.clearAttributes方法代码示例

本文整理汇总了C#中libsbmlcs.XMLNode.clearAttributes方法的典型用法代码示例。如果您正苦于以下问题:C# XMLNode.clearAttributes方法的具体用法?C# XMLNode.clearAttributes怎么用?C# XMLNode.clearAttributes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在libsbmlcs.XMLNode的用法示例。


在下文中一共展示了XMLNode.clearAttributes方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: test_XMLNode_clearAttributes

 public void test_XMLNode_clearAttributes()
 {
     XMLTriple triple = new  XMLTriple("test","","");
       XMLAttributes attr = new  XMLAttributes();
       XMLNode node = new XMLNode(triple,attr);
       XMLTriple xt2 = new  XMLTriple("name3",  "http://name3.org/", "p3");
       XMLTriple xt1 = new  XMLTriple("name5",  "http://name5.org/", "p5");
       int i = node.addAttr( "name1", "val1");
       assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
       assertTrue( node.getAttributes().getLength() == 1 );
       i = node.addAttr( "name2", "val2",  "http://name1.org/", "p1");
       assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
       assertTrue( node.getAttributes().getLength() == 2 );
       i = node.addAttr(xt2, "val2");
       assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
       assertTrue( node.getAttributes().getLength() == 3 );
       i = node.addAttr( "name4", "val4");
       assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
       assertTrue( node.getAttributes().getLength() == 4 );
       i = node.clearAttributes();
       assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
       assertTrue( node.getAttributes().getLength() == 0 );
       xt1 = null;
       xt2 = null;
       triple = null;
       attr = null;
       node = null;
 }
开发者ID:0u812,项目名称:roadrunner-backup,代码行数:28,代码来源:TestXMLNode_newSetters.cs

示例2: test_XMLNode_attribute_set_clear

 public void test_XMLNode_attribute_set_clear()
 {
     XMLTriple triple = new  XMLTriple("test","","");
       XMLAttributes attr = new  XMLAttributes();
       XMLNode node = new XMLNode(triple,attr);
       XMLAttributes nattr = new  XMLAttributes();
       XMLTriple xt1 = new  XMLTriple("name1", "http://name1.org/", "p1");
       XMLTriple xt2 = new  XMLTriple("name2", "http://name2.org/", "p2");
       XMLTriple xt3 = new  XMLTriple("name3", "http://name3.org/", "p3");
       XMLTriple xt4 = new  XMLTriple("name4", "http://name4.org/", "p4");
       XMLTriple xt5 = new  XMLTriple("name5", "http://name5.org/", "p5");
       nattr.add(xt1, "val1");
       nattr.add(xt2, "val2");
       nattr.add(xt3, "val3");
       nattr.add(xt4, "val4");
       nattr.add(xt5, "val5");
       node.setAttributes(nattr);
       assertTrue( node.getAttributesLength() == 5 );
       assertTrue( node.isAttributesEmpty() == false );
       assertTrue( (  "name1" != node.getAttrName(0) ) == false );
       assertTrue( (  "val1"  != node.getAttrValue(0) ) == false );
       assertTrue( (  "http://name1.org/" != node.getAttrURI(0) ) == false );
       assertTrue( (  "p1"    != node.getAttrPrefix(0) ) == false );
       assertTrue( (  "name2" != node.getAttrName(1) ) == false );
       assertTrue( (  "val2"  != node.getAttrValue(1) ) == false );
       assertTrue( (  "http://name2.org/" != node.getAttrURI(1) ) == false );
       assertTrue( (  "p2"    != node.getAttrPrefix(1) ) == false );
       assertTrue( (  "name3" != node.getAttrName(2) ) == false );
       assertTrue( (  "val3"  != node.getAttrValue(2) ) == false );
       assertTrue( (  "http://name3.org/" != node.getAttrURI(2) ) == false );
       assertTrue( (  "p3"    != node.getAttrPrefix(2) ) == false );
       assertTrue( (  "name4" != node.getAttrName(3) ) == false );
       assertTrue( (  "val4"  != node.getAttrValue(3) ) == false );
       assertTrue( (  "http://name4.org/" != node.getAttrURI(3) ) == false );
       assertTrue( (  "p4"    != node.getAttrPrefix(3) ) == false );
       assertTrue( (  "name5" != node.getAttrName(4) ) == false );
       assertTrue( (  "val5"  != node.getAttrValue(4) ) == false );
       assertTrue( (  "http://name5.org/" != node.getAttrURI(4) ) == false );
       assertTrue( (  "p5"    != node.getAttrPrefix(4) ) == false );
       XMLTriple ntriple = new  XMLTriple("test2","http://test2.org/","p2");
       node.setTriple(ntriple);
       assertTrue( (    "test2" != node.getName() ) == false );
       assertTrue( (     "http://test2.org/" != node.getURI() ) == false );
       assertTrue( (  "p2" != node.getPrefix() ) == false );
       node.clearAttributes();
       assertTrue( node.getAttributesLength() == 0 );
       assertTrue( node.isAttributesEmpty() != false );
       triple = null;
       ntriple = null;
       node = null;
       attr = null;
       nattr = null;
       xt1 = null;
       xt2 = null;
       xt3 = null;
       xt4 = null;
       xt5 = null;
 }
开发者ID:alexholehouse,项目名称:SBMLIntegrator,代码行数:58,代码来源:TestXMLNode.cs


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