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


C# libsbml.XMLTriple類代碼示例

本文整理匯總了C#中libsbml.XMLTriple的典型用法代碼示例。如果您正苦於以下問題:C# XMLTriple類的具體用法?C# XMLTriple怎麽用?C# XMLTriple使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


XMLTriple類屬於libsbml命名空間,在下文中一共展示了XMLTriple類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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:mgaldzic,項目名稱:copasi_api,代碼行數:28,代碼來源:TestXMLNode_newSetters.cs

示例2: test_XMLToken_newSetters_addAttributes1

 public void test_XMLToken_newSetters_addAttributes1()
 {
     XMLTriple triple = new  XMLTriple("test","","");
       XMLAttributes attr = new  XMLAttributes();
       XMLToken token = new  XMLToken(triple,attr);
       XMLTriple xt2 = new  XMLTriple("name3", "http://name3.org/", "p3");
       int i = token.addAttr( "name1", "val1");
       assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
       assertTrue( token.getAttributesLength() == 1 );
       assertTrue( token.isAttributesEmpty() == false );
       assertTrue( (  "name1" != token.getAttrName(0) ) == false );
       assertTrue( (  "val1"  != token.getAttrValue(0) ) == false );
       i = token.addAttr( "name2", "val2", "http://name1.org/", "p1");
       assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
       assertTrue( token.getAttributesLength() == 2 );
       assertTrue( token.isAttributesEmpty() == false );
       assertTrue( (  "name2" != token.getAttrName(1) ) == false );
       assertTrue( (  "val2"  != token.getAttrValue(1) ) == false );
       assertTrue( (  "http://name1.org/" != token.getAttrURI(1) ) == false );
       assertTrue( (  "p1"    != token.getAttrPrefix(1) ) == false );
       i = token.addAttr(xt2, "val2");
       assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
       assertTrue( token.getAttributesLength() == 3 );
       assertTrue( token.isAttributesEmpty() == false );
       assertTrue( (  "name3" != token.getAttrName(2) ) == false );
       assertTrue( (  "val2"  != token.getAttrValue(2) ) == false );
       assertTrue( (  "http://name3.org/" != token.getAttrURI(2) ) == false );
       assertTrue( (  "p3"    != token.getAttrPrefix(2) ) == false );
       xt2 = null;
       triple = null;
       attr = null;
       token = null;
 }
開發者ID:mgaldzic,項目名稱:copasi_api,代碼行數:33,代碼來源:TestXMLToken_newSetters.cs

示例3: test_Node_clone

 public void test_Node_clone()
 {
     XMLAttributes att = new XMLAttributes();
       XMLTriple t = new XMLTriple("sarah", "http://foo.org/", "bar");
       XMLToken token = new XMLToken(t,att,3,4);
       XMLNode node = new XMLNode(token);
       XMLNode child = new XMLNode();
       node.addChild(child);
       assertTrue( node.getNumChildren() == 1 );
       assertTrue( node.getName() ==  "sarah" );
       assertTrue( node.getURI() ==  "http://foo.org/" );
       assertTrue( node.getPrefix() ==  "bar" );
       assertTrue( node.isEnd() == false );
       assertTrue( node.isEOF() == false );
       assertTrue( node.getLine() == 3 );
       assertTrue( node.getColumn() == 4 );
       XMLNode node2 = (XMLNode) node.clone();
       assertTrue( node2.getNumChildren() == 1 );
       assertTrue( node2.getName() ==  "sarah" );
       assertTrue( node2.getURI() ==  "http://foo.org/" );
       assertTrue( node2.getPrefix() ==  "bar" );
       assertTrue( node2.isEnd() == false );
       assertTrue( node2.isEOF() == false );
       assertTrue( node2.getLine() == 3 );
       assertTrue( node2.getColumn() == 4 );
       t = null;
       token = null;
       node = null;
       node2 = null;
 }
開發者ID:mgaldzic,項目名稱:copasi_api,代碼行數:30,代碼來源:TestCopyAndClone.cs

示例4: test_XMLNode_addChild3

 public void test_XMLNode_addChild3()
 {
     XMLTriple triple = new  XMLTriple("test","","");
       XMLNode node = new XMLNode(triple);
       XMLNode node2 = new XMLNode();
       int i = node.addChild(node2);
       assertTrue( i == libsbml.LIBSBML_INVALID_XML_OPERATION );
       assertTrue( node.getNumChildren() == 0 );
       triple = null;
       node = null;
       node2 = null;
 }
開發者ID:mgaldzic,項目名稱:copasi_api,代碼行數:12,代碼來源:TestXMLNode_newSetters.cs

示例5: test_XMLNode_addChild2

 public void test_XMLNode_addChild2()
 {
     XMLTriple triple = new  XMLTriple("test","","");
       XMLAttributes attr = new  XMLAttributes();
       XMLNode node = new XMLNode(triple,attr);
       XMLNode node2 = new XMLNode();
       int i = node.addChild(node2);
       assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
       assertTrue( node.getNumChildren() == 1 );
       triple = null;
       attr = null;
       node = null;
       node2 = null;
 }
開發者ID:mgaldzic,項目名稱:copasi_api,代碼行數:14,代碼來源:TestXMLNode_newSetters.cs

示例6: test_XMLAttributes_add1

 public void test_XMLAttributes_add1()
 {
     XMLAttributes xa = new  XMLAttributes();
       XMLTriple xt2 = new  XMLTriple("name2", "http://name2.org/", "p2");
       int i = xa.add( "name1", "val1", "http://name1.org/", "p1");
       assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
       i = xa.add(xt2, "val2");
       assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
       assertTrue( xa.getLength() == 2 );
       assertTrue( xa.isEmpty() == false );
       i = xa.add( "noprefix", "val3");
       assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
       assertTrue( xa.getLength() == 3 );
       assertTrue( xa.isEmpty() == false );
       xa = null;
       xt2 = null;
 }
開發者ID:mgaldzic,項目名稱:copasi_api,代碼行數:17,代碼來源:TestXMLAttributesC.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_XMLToken_newSetters_addAttributes2

 public void test_XMLToken_newSetters_addAttributes2()
 {
     XMLTriple triple = new  XMLTriple("test","","");
       XMLToken token = new  XMLToken(triple);
       XMLTriple xt2 = new  XMLTriple("name3", "http://name3.org/", "p3");
       int i = token.addAttr( "name1", "val1");
       assertTrue( i == libsbml.LIBSBML_INVALID_XML_OPERATION );
       assertTrue( token.getAttributesLength() == 0 );
       assertTrue( token.isAttributesEmpty() == true );
       i = token.addAttr( "name2", "val2", "http://name1.org/", "p1");
       assertTrue( i == libsbml.LIBSBML_INVALID_XML_OPERATION );
       assertTrue( token.getAttributesLength() == 0 );
       assertTrue( token.isAttributesEmpty() == true );
       i = token.addAttr(xt2, "val2");
       assertTrue( i == libsbml.LIBSBML_INVALID_XML_OPERATION );
       assertTrue( token.getAttributesLength() == 0 );
       assertTrue( token.isAttributesEmpty() == true );
       xt2 = null;
       triple = null;
       token = null;
 }
開發者ID:mgaldzic,項目名稱:copasi_api,代碼行數:21,代碼來源:TestXMLToken_newSetters.cs

示例9: test_CVTerm_createFromNode

 public void test_CVTerm_createFromNode()
 {
     XMLAttributes xa;
       XMLTriple qual_triple = new  XMLTriple("is", "", "bqbiol");
       XMLTriple bag_triple = new  XMLTriple();
       XMLTriple li_triple = new  XMLTriple();
       XMLAttributes att = new  XMLAttributes();
       att.add( "", "This is my resource");
       XMLAttributes att1 = new  XMLAttributes();
       XMLToken li_token = new  XMLToken(li_triple,att);
       XMLToken bag_token = new  XMLToken(bag_triple,att1);
       XMLToken qual_token = new  XMLToken(qual_triple,att1);
       XMLNode li = new XMLNode(li_token);
       XMLNode bag = new XMLNode(bag_token);
       XMLNode node = new XMLNode(qual_token);
       bag.addChild(li);
       node.addChild(bag);
       CVTerm term = new  CVTerm(node);
       assertTrue( term != null );
       assertTrue( term.getQualifierType() == libsbml.BIOLOGICAL_QUALIFIER );
       assertTrue( term.getBiologicalQualifierType() == libsbml.BQB_IS );
       xa = term.getResources();
       assertTrue( xa.getLength() == 1 );
       assertTrue((  "rdf:resource" == xa.getName(0) ));
       assertTrue((  "This is my resource" == xa.getValue(0) ));
       qual_triple = null;
       bag_triple = null;
       li_triple = null;
       li_token = null;
       bag_token = null;
       qual_token = null;
       att = null;
       att1 = null;
       term = null;
       node = null;
       bag = null;
       li = null;
 }
開發者ID:mgaldzic,項目名稱:copasi_api,代碼行數:38,代碼來源:TestCVTerms.cs

示例10: getCPtr

 internal static HandleRef getCPtr(XMLTriple obj)
 {
     return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
 }
開發者ID:sys-bio,項目名稱:libroadrunner-deps,代碼行數:4,代碼來源:XMLTriple.cs

示例11: getCPtrAndDisown

        internal static HandleRef getCPtrAndDisown(XMLTriple obj)
        {
            HandleRef ptr = new HandleRef(null, IntPtr.Zero);

            if (obj != null)
            {
            ptr             = obj.swigCPtr;
            obj.swigCMemOwn = false;
            }

            return ptr;
        }
開發者ID:sys-bio,項目名稱:libroadrunner-deps,代碼行數:12,代碼來源:XMLTriple.cs

示例12: test_SBase_appendNotes8

 public void test_SBase_appendNotes8()
 {
     XMLAttributes att = new  XMLAttributes();
       XMLNamespaces ns = new  XMLNamespaces();
       ns.add( "http://www.w3.org/1999/xhtml", "");
       XMLTriple body_triple = new  XMLTriple("body", "", "");
       XMLTriple p_triple = new  XMLTriple("p", "", "");
       XMLToken body_token = new  XMLToken(body_triple,att,ns);
       XMLToken p_token = new  XMLToken(p_triple,att);
       XMLToken text_token = new  XMLToken("This is my text");
       XMLNode body_node = new XMLNode(body_token);
       XMLNode p_node = new XMLNode(p_token);
       XMLNode text_node = new XMLNode(text_token);
       XMLToken p_token1 = new  XMLToken(p_triple,att,ns);
       XMLToken text_token1 = new  XMLToken("This is more text");
       XMLNode p_node1 = new XMLNode(p_token1);
       XMLNode text_node1 = new XMLNode(text_token1);
       XMLNode notes;
       XMLNode child, child1;
       p_node.addChild(text_node);
       body_node.addChild(p_node);
       p_node1.addChild(text_node1);
       S.setNotes(body_node);
       S.appendNotes(p_node1);
       notes = S.getNotes();
       assertTrue((  "notes" == notes.getName() ));
       assertTrue( notes.getNumChildren() == 1 );
       child = notes.getChild(0);
       assertTrue((  "body" == child.getName() ));
       assertTrue( child.getNumChildren() == 2 );
       child1 = child.getChild(0);
       assertTrue((  "p" == child1.getName() ));
       assertTrue( child1.getNumChildren() == 1 );
       child1 = child1.getChild(0);
       assertTrue((  "This is my text" == child1.getCharacters() ));
       assertTrue( child1.getNumChildren() == 0 );
       child1 = child.getChild(1);
       assertTrue((  "p" == child1.getName() ));
       assertTrue( child1.getNumChildren() == 1 );
       child1 = child1.getChild(0);
       assertTrue((  "This is more text" == child1.getCharacters() ));
       assertTrue( child1.getNumChildren() == 0 );
       att = null;
       ns = null;
       body_triple = null;
       p_triple = null;
       body_token = null;
       p_token = null;
       text_token = null;
       text_token1 = null;
       p_token1 = null;
       body_node = null;
       p_node = null;
       text_node = null;
       p_node1 = null;
       text_node1 = null;
 }
開發者ID:mgaldzic,項目名稱:copasi_api,代碼行數:57,代碼來源:TestSBase.cs

示例13: XMLTriple

 /**
    * Copy constructor; creates a copy of this XMLTriple object.
    *
    * @param orig the XMLTriple object to copy.
    */
 public XMLTriple(XMLTriple orig)
     : this(libsbmlPINVOKE.new_XMLTriple__SWIG_4(XMLTriple.getCPtr(orig)), true)
 {
     if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve();
 }
開發者ID:sys-bio,項目名稱:libroadrunner-deps,代碼行數:10,代碼來源:XMLTriple.cs

示例14: startEndElement

 /**
    * Writes the given XML start and end element 'prefix:name' to this
    * XMLOutputStream.
    */
 public void startEndElement(XMLTriple triple)
 {
     libsbmlPINVOKE.XMLOutputStream_startEndElement__SWIG_2(swigCPtr, XMLTriple.getCPtr(triple));
     if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve();
 }
開發者ID:TotteKarlsson,項目名稱:roadrunner,代碼行數:9,代碼來源:XMLOutputStream.cs

示例15: getIndex

 /**
    * Returns the index of the attribute defined by the given XMLTriple object.
    *
    * @param triple an XMLTriple describing the attribute being sought.
    *
    * @return the index of an attribute described by the given XMLTriple
    * object, or <code>-1</code> if no such attribute is present.
    *
    * @see hasAttribute(string name, string uri)
    * @see hasAttribute(XMLTriple triple)
    */
 public int getIndex(XMLTriple triple)
 {
     int ret = libsbmlPINVOKE.XMLAttributes_getIndex__SWIG_2(swigCPtr, XMLTriple.getCPtr(triple));
     if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve();
     return ret;
 }
開發者ID:sys-bio,項目名稱:libroadrunner-deps,代碼行數:17,代碼來源:XMLAttributes.cs


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