libsbml.XMLAttributes.add C# (CSharp) Method

add() public method

public add ( XMLTriple triple, string value ) : int
triple XMLTriple
value string
return int
        public int add(XMLTriple triple, string value)
        {
            int ret = libsbmlPINVOKE.XMLAttributes_add__SWIG_3(swigCPtr, XMLTriple.getCPtr(triple), value);
            if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve();
            return ret;
        }

Same methods

XMLAttributes::add ( string name, string value ) : int
XMLAttributes::add ( string name, string value, string namespaceURI ) : int
XMLAttributes::add ( string name, string value, string namespaceURI, string prefix ) : int

Usage Example

 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;
 }
All Usage Examples Of libsbml.XMLAttributes::add