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


C# XMLNamespaces.add方法代码示例

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


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

示例1: test_SpeciesReference_createWithNS

 public void test_SpeciesReference_createWithNS()
 {
     XMLNamespaces xmlns = new  XMLNamespaces();
       xmlns.add( "http://www.sbml.org", "testsbml");
       SBMLNamespaces sbmlns = new  SBMLNamespaces(2,1);
       sbmlns.addNamespaces(xmlns);
       SpeciesReference object1 = new  SpeciesReference(sbmlns);
       assertTrue( object1.getTypeCode() == libsbml.SBML_SPECIES_REFERENCE );
       assertTrue( object1.getMetaId() == "" );
       assertTrue( object1.getNotes() == null );
       assertTrue( object1.getAnnotation() == null );
       assertTrue( object1.getLevel() == 2 );
       assertTrue( object1.getVersion() == 1 );
       assertTrue( object1.getNamespaces() != null );
       assertTrue( object1.getNamespaces().getLength() == 2 );
       object1 = null;
 }
开发者ID:mgaldzic,项目名称:copasi_api,代码行数:17,代码来源:TestSpeciesReference.cs

示例2: test_EventAssignment_createWithNS

 public void test_EventAssignment_createWithNS()
 {
     XMLNamespaces xmlns = new  XMLNamespaces();
       xmlns.add( "http://www.sbml.org", "testsbml");
       SBMLNamespaces sbmlns = new  SBMLNamespaces(2,1);
       sbmlns.addNamespaces(xmlns);
       EventAssignment object1 = new  EventAssignment(sbmlns);
       assertTrue( object1.getTypeCode() == libsbml.SBML_EVENT_ASSIGNMENT );
       assertTrue( object1.getMetaId() == "" );
       assertTrue( object1.getNotes() == null );
       assertTrue( object1.getAnnotation() == null );
       assertTrue( object1.getLevel() == 2 );
       assertTrue( object1.getVersion() == 1 );
       assertTrue( object1.getNamespaces() != null );
       assertTrue( object1.getNamespaces().getLength() == 2 );
       object1 = null;
 }
开发者ID:mgaldzic,项目名称:copasi_api,代码行数:17,代码来源:TestEventAssignment.cs

示例3: test_CompartmentType_createWithNS

 public void test_CompartmentType_createWithNS()
 {
     XMLNamespaces xmlns = new  XMLNamespaces();
       xmlns.add( "http://www.sbml.org", "testsbml");
       SBMLNamespaces sbmlns = new  SBMLNamespaces(2,2);
       sbmlns.addNamespaces(xmlns);
       CompartmentType object1 = new  CompartmentType(sbmlns);
       assertTrue( object1.getTypeCode() == libsbml.SBML_COMPARTMENT_TYPE );
       assertTrue( object1.getMetaId() == "" );
       assertTrue( object1.getNotes() == null );
       assertTrue( object1.getAnnotation() == null );
       assertTrue( object1.getLevel() == 2 );
       assertTrue( object1.getVersion() == 2 );
       assertTrue( object1.getNamespaces() != null );
       assertTrue( object1.getNamespaces().getLength() == 2 );
       object1 = null;
 }
开发者ID:mgaldzic,项目名称:copasi_api,代码行数:17,代码来源:TestCompartmentType.cs

示例4: test_StoichiometryMath_createWithNS

 public void test_StoichiometryMath_createWithNS()
 {
     XMLNamespaces xmlns = new  XMLNamespaces();
       xmlns.add( "http://www.sbml.org", "testsbml");
       SBMLNamespaces sbmlns = new  SBMLNamespaces(2,1);
       sbmlns.addNamespaces(xmlns);
       StoichiometryMath object1 = new  StoichiometryMath(sbmlns);
       assertTrue( object1.getTypeCode() == libsbml.SBML_STOICHIOMETRY_MATH );
       assertTrue( object1.getMetaId() == "" );
       assertTrue( object1.getNotes() == null );
       assertTrue( object1.getAnnotation() == null );
       assertTrue( object1.getLevel() == 2 );
       assertTrue( object1.getVersion() == 1 );
       assertTrue( object1.getNamespaces() != null );
       assertTrue( object1.getNamespaces().getLength() == 2 );
       object1 = null;
 }
开发者ID:mgaldzic,项目名称:copasi_api,代码行数:17,代码来源:TestStoichiometryMath.cs

示例5: test_RateRule_createWithNS

 public void test_RateRule_createWithNS()
 {
     XMLNamespaces xmlns = new  XMLNamespaces();
       xmlns.add( "http://www.sbml.org", "testsbml");
       SBMLNamespaces sbmlns = new  SBMLNamespaces(2,1);
       sbmlns.addNamespaces(xmlns);
       Rule object1 = new  RateRule(sbmlns);
       assertTrue( object1.getTypeCode() == libsbml.SBML_RATE_RULE );
       assertTrue( object1.getMetaId() == "" );
       assertTrue( object1.getNotes() == null );
       assertTrue( object1.getAnnotation() == null );
       assertTrue( object1.getLevel() == 2 );
       assertTrue( object1.getVersion() == 1 );
       assertTrue( object1.getNamespaces() != null );
       assertTrue( object1.getNamespaces().getLength() == 2 );
       object1 = null;
 }
开发者ID:mgaldzic,项目名称:copasi_api,代码行数:17,代码来源:TestRateRule.cs

示例6: test_Parameter_createWithNS

 public void test_Parameter_createWithNS()
 {
     XMLNamespaces xmlns = new  XMLNamespaces();
       xmlns.add( "http://www.sbml.org", "testsbml");
       SBMLNamespaces sbmlns = new  SBMLNamespaces(2,1);
       sbmlns.addNamespaces(xmlns);
       Parameter object1 = new  Parameter(sbmlns);
       assertTrue( object1.getTypeCode() == libsbml.SBML_PARAMETER );
       assertTrue( object1.getMetaId() == "" );
       assertTrue( object1.getNotes() == null );
       assertTrue( object1.getAnnotation() == null );
       assertTrue( object1.getLevel() == 2 );
       assertTrue( object1.getVersion() == 1 );
       assertTrue( object1.getNamespaces() != null );
       assertTrue( object1.getNamespaces().getLength() == 2 );
       object1 = null;
 }
开发者ID:mgaldzic,项目名称:copasi_api,代码行数:17,代码来源:TestParameter.cs

示例7: test_SyntaxChecker_validXHTML

 public void test_SyntaxChecker_validXHTML()
 {
     XMLToken token;
       XMLNode node;
       XMLTriple triple = new  XMLTriple("p", "", "");
       XMLAttributes att = new  XMLAttributes();
       XMLNamespaces ns = new  XMLNamespaces();
       ns.add( "http://www.w3.org/1999/xhtml", "");
       XMLToken tt = new  XMLToken("This is my text");
       XMLNode n1 = new XMLNode(tt);
       token = new  XMLToken(triple,att,ns);
       node = new XMLNode(token);
       node.addChild(n1);
       assertTrue( SyntaxChecker.hasExpectedXHTMLSyntax(node,null) == false );
       triple = new  XMLTriple("html", "", "");
       ns.clear();
       token = new  XMLToken(triple,att,ns);
       node = new XMLNode(token);
       node.addChild(n1);
       assertTrue( SyntaxChecker.hasExpectedXHTMLSyntax(node,null) == false );
 }
开发者ID:mgaldzic,项目名称:copasi_api,代码行数:21,代码来源:TestSyntaxChecker.cs

示例8: test_L3_Event_createWithNS

 public void test_L3_Event_createWithNS()
 {
     XMLNamespaces xmlns = new  XMLNamespaces();
       xmlns.add( "http://www.sbml.org", "testsbml");
       SBMLNamespaces sbmlns = new  SBMLNamespaces(3,1);
       sbmlns.addNamespaces(xmlns);
       Event e = new  Event(sbmlns);
       assertTrue( e.getTypeCode() == libsbml.SBML_EVENT );
       assertTrue( e.getMetaId() == "" );
       assertTrue( e.getNotes() == null );
       assertTrue( e.getAnnotation() == null );
       assertTrue( e.getLevel() == 3 );
       assertTrue( e.getVersion() == 1 );
       assertTrue( e.getNamespaces() != null );
       assertTrue( e.getNamespaces().getLength() == 2 );
       assertTrue( e.getId() == "" );
       assertTrue( e.getName() == "" );
       assertTrue( e.getUseValuesFromTriggerTime() == true );
       assertEquals( false, e.isSetId() );
       assertEquals( false, e.isSetName() );
       assertEquals( false, e.isSetUseValuesFromTriggerTime() );
       e = null;
 }
开发者ID:mgaldzic,项目名称:copasi_api,代码行数:23,代码来源:TestL3Event.cs

示例9: test_WriteSBML_Constraint_full

 public void test_WriteSBML_Constraint_full()
 {
     D.setLevelAndVersion(2,2,false);
       string expected = "<constraint sboTerm=\"SBO:0000064\">\n" +
     "  <math xmlns=\"http://www.w3.org/1998/Math/MathML\">\n" +
     "    <apply>\n" +
     "      <leq/>\n" +
     "      <ci> P1 </ci>\n" +
     "      <ci> t </ci>\n" +
     "    </apply>\n" +
     "  </math>\n" +
     "  <message>\n" +
     "    <p xmlns=\"http://www.w3.org/1999/xhtml\"> Species P1 is out of range </p>\n" +
     "  </message>\n" +
     "</constraint>";
       Constraint c = D.createModel().createConstraint();
       ASTNode node = libsbml.parseFormula("leq(P1,t)");
       c.setMath(node);
       c.setSBOTerm(64);
       XMLNode text = XMLNode.convertStringToXMLNode(" Species P1 is out of range ");
       XMLTriple triple = new XMLTriple("p", "http://www.w3.org/1999/xhtml", "");
       XMLAttributes att = new XMLAttributes();
       XMLNamespaces xmlns = new XMLNamespaces();
       xmlns.add("http://www.w3.org/1999/xhtml");
       XMLNode p = new XMLNode(triple,att,xmlns);
       p.addChild(text);
       XMLTriple triple1 = new XMLTriple("message", "", "");
       XMLAttributes att1 = new XMLAttributes();
       XMLNode message = new XMLNode(triple1,att1);
       message.addChild(p);
       c.setMessage(message);
       assertEquals( true, equals(expected,c.toSBML()) );
 }
开发者ID:mgaldzic,项目名称:copasi_api,代码行数:33,代码来源:TestWriteSBML.cs

示例10: test_XMLNode_createElement

 public void test_XMLNode_createElement()
 {
     XMLTriple triple;
       XMLAttributes attr;
       XMLNamespaces ns;
       XMLNode snode, enode, tnode;
       XMLAttributes cattr;
       string name =  "test";
       string uri =  "http://test.org/";
       string prefix =  "p";
       string text =  "text node";
       triple = new  XMLTriple(name,uri,prefix);
       ns = new  XMLNamespaces();
       attr = new  XMLAttributes();
       ns.add(uri,prefix);
       attr.add("id", "value",uri,prefix);
       snode = new XMLNode(triple,attr,ns);
       assertTrue( snode != null );
       assertTrue( snode.getNumChildren() == 0 );
       assertTrue( ( name != snode.getName() ) == false );
       assertTrue( ( prefix != snode.getPrefix() ) == false );
       assertTrue( ( uri != snode.getURI() ) == false );
       assertTrue( snode.isElement() == true );
       assertTrue( snode.isStart() == true );
       assertTrue( snode.isEnd() == false );
       assertTrue( snode.isText() == false );
       snode.setEnd();
       assertTrue( snode.isEnd() == true );
       snode.unsetEnd();
       assertTrue( snode.isEnd() == false );
       cattr = snode.getAttributes();
       assertTrue( cattr != null );
       assertTrue( (  "id"    != cattr.getName(0) ) == false );
       assertTrue( (  "value" != cattr.getValue(0) ) == false );
       assertTrue( ( prefix != cattr.getPrefix(0) ) == false );
       assertTrue( ( uri != cattr.getURI(0) ) == false );
       triple = null;
       attr = null;
       ns = null;
       snode = null;
       attr = new  XMLAttributes();
       attr.add("id", "value");
       triple = new  XMLTriple(name, "", "");
       snode = new XMLNode(triple,attr);
       assertTrue( snode != null );
       assertTrue( snode.getNumChildren() == 0 );
       assertTrue( (  "test" != snode.getName() ) == false );
       assertTrue( snode.getPrefix() == "" );
       assertTrue( snode.getURI() == "" );
       assertTrue( snode.isElement() == true );
       assertTrue( snode.isStart() == true );
       assertTrue( snode.isEnd() == false );
       assertTrue( snode.isText() == false );
       cattr = snode.getAttributes();
       assertTrue( cattr != null );
       assertTrue( (  "id"    != cattr.getName(0) ) == false );
       assertTrue( (  "value" != cattr.getValue(0) ) == false );
       assertTrue( cattr.getPrefix(0) == "" );
       assertTrue( cattr.getURI(0) == "" );
       enode = new XMLNode(triple);
       assertTrue( enode != null );
       assertTrue( enode.getNumChildren() == 0 );
       assertTrue( (  "test" != enode.getName() ) == false );
       assertTrue( enode.getPrefix() == "" );
       assertTrue( enode.getURI() == "" );
       assertTrue( enode.isElement() == true );
       assertTrue( enode.isStart() == false );
       assertTrue( enode.isEnd() == true );
       assertTrue( enode.isText() == false );
       tnode = new XMLNode(text);
       assertTrue( tnode != null );
       assertTrue( ( text != tnode.getCharacters() ) == false );
       assertTrue( tnode.getNumChildren() == 0 );
       assertTrue( tnode.getName() == "" );
       assertTrue( tnode.getPrefix() == "" );
       assertTrue( tnode.getURI() == "" );
       assertTrue( tnode.isElement() == false );
       assertTrue( tnode.isStart() == false );
       assertTrue( tnode.isEnd() == false );
       assertTrue( tnode.isText() == true );
       triple = null;
       attr = null;
       snode = null;
       enode = null;
       tnode = null;
 }
开发者ID:mgaldzic,项目名称:copasi_api,代码行数:86,代码来源:TestXMLNode.cs

示例11: test_Constraint_setMessage

 public void test_Constraint_setMessage()
 {
     XMLNode text = XMLNode.convertStringToXMLNode(" Some text ",null);
       XMLTriple triple = new  XMLTriple("p", "http://www.w3.org/1999/xhtml", "");
       XMLAttributes att = new  XMLAttributes();
       XMLNamespaces xmlns = new  XMLNamespaces();
       xmlns.add( "http://www.w3.org/1999/xhtml", "");
       XMLNode p = new XMLNode(triple,att,xmlns);
       p.addChild(text);
       XMLTriple triple1 = new  XMLTriple("message", "", "");
       XMLAttributes att1 = new  XMLAttributes();
       XMLNode node = new XMLNode(triple1,att1);
       node.addChild(p);
       C.setMessage(node);
       assertTrue( C.getMessage() != node );
       assertTrue( C.isSetMessage() == true );
       C.setMessage(C.getMessage());
       assertTrue( C.getMessage() != node );
       assertTrue( C.getMessageString() != null );
       C.unsetMessage();
       assertEquals( false, C.isSetMessage() );
       if (C.getMessage() != null);
       {
       }
       node = null;
 }
开发者ID:mgaldzic,项目名称:copasi_api,代码行数:26,代码来源:TestConstraint.cs

示例12: test_L3_Unit_createWithNS

 public void test_L3_Unit_createWithNS()
 {
     XMLNamespaces xmlns = new  XMLNamespaces();
       xmlns.add( "http://www.sbml.org", "testsbml");
       SBMLNamespaces sbmlns = new  SBMLNamespaces(3,1);
       sbmlns.addNamespaces(xmlns);
       Unit u = new  Unit(sbmlns);
       assertTrue( u.getTypeCode() == libsbml.SBML_UNIT );
       assertTrue( u.getMetaId() == "" );
       assertTrue( u.getNotes() == null );
       assertTrue( u.getAnnotation() == null );
       assertTrue( u.getLevel() == 3 );
       assertTrue( u.getVersion() == 1 );
       assertTrue( u.getNamespaces() != null );
       assertTrue( u.getNamespaces().getLength() == 2 );
       assertTrue( u.getKind() == libsbml.UNIT_KIND_INVALID );
       assertEquals( true, isnan(u.getExponentAsDouble()) );
       assertEquals( true, isnan(u.getMultiplier()) );
       assertEquals( false, u.isSetKind() );
       assertEquals( false, u.isSetExponent() );
       assertEquals( false, u.isSetMultiplier() );
       assertEquals( false, u.isSetScale() );
       u = null;
 }
开发者ID:mgaldzic,项目名称:copasi_api,代码行数:24,代码来源:TestL3Unit.cs

示例13: test_L3_Compartment_createWithNS

 public void test_L3_Compartment_createWithNS()
 {
     XMLNamespaces xmlns = new  XMLNamespaces();
       xmlns.add( "http://www.sbml.org", "testsbml");
       SBMLNamespaces sbmlns = new  SBMLNamespaces(3,1);
       sbmlns.addNamespaces(xmlns);
       Compartment c = new  Compartment(sbmlns);
       assertTrue( c.getTypeCode() == libsbml.SBML_COMPARTMENT );
       assertTrue( c.getMetaId() == "" );
       assertTrue( c.getNotes() == null );
       assertTrue( c.getAnnotation() == null );
       assertTrue( c.getLevel() == 3 );
       assertTrue( c.getVersion() == 1 );
       assertTrue( c.getNamespaces() != null );
       assertTrue( c.getNamespaces().getLength() == 2 );
       assertTrue( c.getId() == "" );
       assertTrue( c.getName() == "" );
       assertTrue( c.getUnits() == "" );
       assertTrue( c.getOutside() == "" );
       assertEquals( true, isnan(c.getSpatialDimensionsAsDouble()) );
       assertEquals( true, isnan(c.getVolume()) );
       assertTrue( c.getConstant() == true );
       assertEquals( false, c.isSetId() );
       assertEquals( false, c.isSetSpatialDimensions() );
       assertEquals( false, c.isSetName() );
       assertEquals( false, c.isSetSize() );
       assertEquals( false, c.isSetVolume() );
       assertEquals( false, c.isSetUnits() );
       assertEquals( false, c.isSetOutside() );
       assertEquals( false, c.isSetConstant() );
       c = null;
 }
开发者ID:mgaldzic,项目名称:copasi_api,代码行数:32,代码来源:TestL3Compartment.cs

示例14: test_NS_copyConstructor

 public void test_NS_copyConstructor()
 {
     XMLNamespaces ns = new XMLNamespaces();
       ns.add("http://test1.org/", "test1");
       assertTrue( ns.getLength() == 1 );
       assertTrue( ns.isEmpty() == false );
       assertTrue( ns.getPrefix(0) ==  "test1" );
       assertTrue( ns.getURI("test1") ==  "http://test1.org/" );
       XMLNamespaces ns2 = new XMLNamespaces(ns);
       assertTrue( ns2.getLength() == 1 );
       assertTrue( ns2.isEmpty() == false );
       assertTrue( ns2.getPrefix(0) ==  "test1" );
       assertTrue( ns2.getURI("test1") ==  "http://test1.org/" );
       ns2 = null;
       ns = null;
 }
开发者ID:mgaldzic,项目名称:copasi_api,代码行数:16,代码来源:TestCopyAndClone.cs

示例15: test_L3_SpeciesReference_createWithNS

 public void test_L3_SpeciesReference_createWithNS()
 {
     XMLNamespaces xmlns = new  XMLNamespaces();
       xmlns.add( "http://www.sbml.org", "testsbml");
       SBMLNamespaces sbmlns = new  SBMLNamespaces(3,1);
       sbmlns.addNamespaces(xmlns);
       SpeciesReference sr = new  SpeciesReference(sbmlns);
       assertTrue( sr.getTypeCode() == libsbml.SBML_SPECIES_REFERENCE );
       assertTrue( sr.getMetaId() == "" );
       assertTrue( sr.getNotes() == null );
       assertTrue( sr.getAnnotation() == null );
       assertTrue( sr.getLevel() == 3 );
       assertTrue( sr.getVersion() == 1 );
       assertTrue( sr.getNamespaces() != null );
       assertTrue( sr.getNamespaces().getLength() == 2 );
       assertTrue( sr.getId() == "" );
       assertTrue( sr.getName() == "" );
       assertTrue( sr.getSpecies() == "" );
       assertEquals( true, isnan(sr.getStoichiometry()) );
       assertTrue( sr.getConstant() == false );
       assertEquals( false, sr.isSetId() );
       assertEquals( false, sr.isSetName() );
       assertEquals( false, sr.isSetSpecies() );
       assertEquals( false, sr.isSetStoichiometry() );
       assertEquals( false, sr.isSetConstant() );
       sr = null;
 }
开发者ID:mgaldzic,项目名称:copasi_api,代码行数:27,代码来源:TestL3SpeciesReference.cs


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