本文整理汇总了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;
}
示例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;
}