Repository.XFRACAS.SerializeXMLObjectToByteArray: Difference between revisions

From ReliaWiki
Jump to navigation Jump to search
No edit summary
Line 23: Line 23:
  '{{APIComment|Serialize the xmlObject into the byteArray.}}
  '{{APIComment|Serialize the xmlObject into the byteArray.}}
  {{APIPrefix|Dim}} SerializeSuccess {{APIPrefix|As Boolean}}
  {{APIPrefix|Dim}} SerializeSuccess {{APIPrefix|As Boolean}}
  SerializeSuccess = MyRepository.[[Repository.SerializeXMLObjectToByteArray|SerializeXMLObjectToByteArray]](byteArray, xmlObject)
  SerializeSuccess = MyRepository.XFRACAS.[[Repository.SerializeXMLObjectToByteArray|SerializeXMLObjectToByteArray]](byteArray, xmlObject)
 
=== Reformatted Usage Example ===
{{APIComment|Declare a new repository connection class.}}
        Private WithEvents MyRepository As New Repository
 
{{APIComment|Connect to the desired Synthesis repository.}}
        Dim Success As Boolean = False
        Success = MyRepository.ConnectToRepository("RepositoryFileNamePath")
 
{{APIComment|Define an serializable XML Object.}}
        Dim xmlObject As Object = Nothing
        'populate the xmlObject with values to import
 
{{APIComment|Define the byte array.}}
        Dim byteArray As Byte() = Nothing
 
{{APIComment|Serialize the xmlObject into the byteArray.}}
        Dim SerializeSuccess As Boolean
        SerializeSuccess = MyRepository.SerializeXMLObjectToByteArray(byteArray, xmlObject)

Revision as of 15:56, 27 May 2015


A helper function to serialize XMLs for import into XFRACAS through a byte array.

Syntax

  • SerializeXMLObjectToByteArray( pData() As Byte, pObject As Object) As Integer

Parameters

pData: A defined byte array to return the
pObject: A serializable XML object.

Usage Example

' Declare a new repository connection class. 
Private WithEvents MyRepository As New Repository
' Connect to the desired Synthesis repository. 
Dim Success As Boolean = False
Success = MyRepository.ConnectToRepository("RepositoryFileNamePath")
' Define an serializable XML Object. 
Dim xmlObject As Object=Nothing
 'populate the xmlObject with values to import 
' Define the byte array. 
Dim byteArray As Byte()=Nothing
' Serialize the xmlObject into the byteArray. 
Dim SerializeSuccess As Boolean
SerializeSuccess = MyRepository.XFRACAS.SerializeXMLObjectToByteArray(byteArray, xmlObject)