VB.Net Sample : Music Store
Schema Summary This sample shows how a to use the generated code to implement a simple request response (client/server) application. Schema Details The Request represents a search request for an album (like the interfaces exposed by Amazon or Play). The response represents the result of the search, in this case either a set of results or an error. If results are returned then this may contain 0-n products (a product being an album), each album has one or more tracks, and a track has a title and length. Sample Description The sample demonstrates how to Create a request document, get the underlying XML. Decode the request, and build a response. Then decode and display the response. In short both side of a very simple client server application. |
Sample XML File
MusicStore_Sample_Response.xml |
<?xml version="1.0" encoding="UTF-8"?> <SearchResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="MusicStore.xsd"> <Result> <SearchDate>2003-01-20</SearchDate> <Product Label="Parlophone" ProductCode="0004U94562457MS" RRP="7.99"> <AlbumName>Parachutes</AlbumName> <ArtistName>ColdPlay</ArtistName> <Track> <Title>Don't Panic</Title> <Length>PT2M10S</Length> </Track> <Track> <Title>Shiver</Title> <Length>PT3M10S</Length> </Track> <Track> <Title>Spies</Title> <Length>PT2M12S</Length> </Track> <Track> <Title>Sparks</Title> <Length>PT3M40S</Length> </Track> <Track> <Title>Yellow</Title> <Length>PT6M12S</Length> </Track> <Track> <Title>Trouble</Title> <Length>PT3M12S</Length> </Track> <Track> <Title>Parachutes</Title> <Length>PT3M21S</Length> </Track> <Track> <Title>High Speed</Title> <Length>PT4M10S</Length> </Track> <Track> <Title>We Never Change</Title> <Length>PT4M36S</Length> </Track> <Track> <Title>Everything's Not Lost</Title> <Length>PT2M59S</Length> </Track> </Product> <Product Label="Parlophone" ProductCode="1001542157321SW" RRP="8.59"> <AlbumName>X&Y</AlbumName> <ArtistName>ColdPlay</ArtistName> <Track> <Title>Square One</Title> <Length>PT2M10S</Length> </Track> <Track> <Title>What If</Title> <Length>PT3M01S</Length> </Track> <Track> <Title>White Shadows</Title> <Length>PT3M04S</Length> </Track> <Track> <Title>Fix You</Title> <Length>PT4M36S</Length> </Track> <Track> <Title>Talk</Title> <Length>PT5M42S</Length> </Track> <Track> <Title>X&Y</Title> <Length>PT2M12S</Length> </Track> <Track> <Title>Speed Of Sound</Title> <Length>PT3M58S</Length> </Track> <Track> <Title>A Message</Title> <Length>PT4M15S</Length> </Track> <Track> <Title>Low</Title> <Length>PT3M21S</Length> </Track> <Track> <Title>The Hardest Part</Title> <Length>PT4M24S</Length> </Track> <Track> <Title>Swallowed In The Sea</Title> <Length>PT2M35S</Length> </Track> <Track> <Title>Twisted Logic</Title> <Length>PT5M54S</Length> </Track> <Track> <Title>Till Kingdom Come</Title> <Length>PT10M15S</Length> </Track> </Product> </Result> </SearchResponse> |
Read Sample | ||
'string strXmlRequest = CreateSearchRequest() 'string strXmlResponse = ProcessSearchRequest(strXmlRequest) 'DisplayResults(strXmlResponse) Private Shared Function CreateSearchRequest() As String ' create an instance of the class Dim request As MusicStoreLib.SearchRequest = New MusicStoreLib.SearchRequest() ' setup our search criteria request.NameFilter = "coldplay" request.PriceFilter.MaxPrice = 9.99 ' Return the Request XML Return request.ToXml() End Function
Private Shared Function ProcessSearchRequest(ByVal strRequestXML As String) As String ' create an instance of the class to load the XML file into Dim request As MusicStoreLib.SearchRequest = New MusicStoreLib.SearchRequest() ' load the request request.FromXml(strRequestXML) ' use the search criteria in a query Dim strXmlResponse As String = GetSearchResults(request.NameFilter, IIf(Not request.PriceFilter.MinPrice Is Nothing, request.PriceFilter.MinPrice, 0), IIf(Not request.PriceFilter.MaxPrice Is Nothing, request.PriceFilter.MaxPrice, Double.MaxValue)) Return strXmlResponse End Function Private Shared Function GetSearchResults(ByVal strNameFilter As String, ByVal minValueFilter As Double, ByVal maxValueFilter As Double) As String ' setup Database query (use your imagination!) Dim strSQLAlbum As String = _ "SELECT * " + _ "FROM Album " + _ "WHERE ArtistName = @ArtistFilter AND " + _ " Price > @MinPriceFilter AND " + _ " Price < @MaxPriceFilter AND " Dim strSQLTrack As String = _ "SELECT * " + _ "FROM Track " + _ "WHERE AlbumID = @AlbumID" Dim conn As SqlConnection = New SqlConnection("...") Dim cmdAlbum As SqlCommand = New SqlCommand(strSQLAlbum, conn) Dim adpAlbum As SqlDataAdapter = New SqlDataAdapter() Dim dsAlbum As DataSet = New DataSet() Dim cmdTrack As SqlCommand = New SqlCommand(strSQLTrack, conn) Dim adpTrack As SqlDataAdapter = New SqlDataAdapter() Dim dsTrack As DataSet = New DataSet() cmdAlbum.Parameters.Add(strNameFilter) cmdAlbum.Parameters.Add(minValueFilter) cmdAlbum.Parameters.Add(maxValueFilter) cmdTrack.Parameters.Add(0) ' query the database adpAlbum.SelectCommand = cmdAlbum adpAlbum.Fill(dsAlbum, "Album") ' create an instance of the class to load the XML file into Dim response As MusicStoreLib.SearchResponse = New MusicStoreLib.SearchResponse() response.Result.SearchDate = New LiquidTechnologies.Runtime.XmlDateTime(DateTime.Now) Dim rAlbum As DataRow For Each rAlbum In dsAlbum.Tables("Album").Rows ' Add a new album to the collection Dim album As MusicStoreLib.AlbumType = New MusicStoreLib.AlbumType() response.Result.Product.Add(album) ' populate the album album.AlbumName = rAlbum("AlbumName").ToString() album.ArtistName = rAlbum("ArtistName").ToString() album.Label = rAlbum("RecordLabel").ToString() album.ProductCode = rAlbum("ProductCode").ToString() If (Not rAlbum("Price") Is Nothing) Then album.RRP = rAlbum("Price") End If ' Query the DB for all the tracks in the album cmdTrack.Parameters(0).Value = rAlbum("AlbumID") adpTrack.SelectCommand = cmdTrack adpTrack.Fill(dsTrack, "Track") ' add all the tracks Dim rTrack As DataRow For Each rTrack In dsTrack.Tables("Track").Rows ' create a track in the XML Dim track As MusicStoreLib.TrackType = New MusicStoreLib.TrackType() album.Track.Add(track) ' populate the track track.Title = rTrack("Title").ToString() track.Length.Seconds = rTrack("Duration") Next rTrack Next rAlbum ' always call Close when done reading. conn.Close() ' return the XML Return response.ToXml() End Function Private Shared Sub DisplayResults(ByVal strXmlResponse As String) ' create an instance of the class to load the XML file into Dim response As MusicStoreLib.SearchResponse = New MusicStoreLib.SearchResponse() ' load the xml from a file into the object (the root element in the ' xml document must be <SearchResponse>. response.FromXml(strXmlResponse) If (response.ChoiceSelectedElement = "Result") Then Console.WriteLine("Query Was Executes {0}", response.Result.SearchDate) Dim album As MusicStoreLib.AlbumType For Each album In response.Result.Product ' ouput each album that was found Console.WriteLine("Artist Name : {0}", album.ArtistName) Console.WriteLine("Album Title : {0}", album.AlbumName) Console.WriteLine("Product Code : {0}", album.ProductCode) Console.WriteLine("Record Label : {0}", album.Label) If (Not album.RRP Is Nothing) Then Console.WriteLine("Price : {0}", album.RRP) End If ' output the tracks Dim track As MusicStoreLib.TrackType For Each track In album.Track Console.WriteLine(" Track Name: {0} ({1:D2}:{2:D2})", _ track.Title, _ track.Length.Minutes, _ track.Length.Seconds) Next track Next album ElseIf (response.ChoiceSelectedElement = "Error") Then Console.WriteLine("An Error Occured") Console.WriteLine("Error Code : {0}", response.Error_.ErrorCode) Console.WriteLine("Descritpion : {0}", response.Error_.ErrorDescription) If (Not response.Error_.HelpFile Is Nothing) Then Console.WriteLine("Help File : {0}", response.Error_.HelpFile) Else ' error - should always have a result or an error End If End If End Sub
|
MusicStore.xsd |
<?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified"> <xs:element name="SearchRequest"> <xs:complexType> <xs:sequence> <xs:element name="PriceFilter"> <xs:complexType> <xs:sequence> <xs:element name="MinPrice" type="xs:double" minOccurs="0"/> <xs:element name="MaxPrice" type="xs:double" minOccurs="0"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="NameFilter" type="xs:string"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="SearchResponse"> <xs:complexType> <xs:choice> <xs:element name="Result"> <xs:complexType> <xs:sequence> <xs:element name="SearchDate" type="xs:date"/> <xs:element name="Product" type="AlbumType" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="Error"> <xs:complexType> <xs:sequence> <xs:element name="ErrorCode" type="xs:int"/> <xs:element name="ErrorDescription" type="xs:string"/> <xs:element name="HelpFile" type="xs:string" minOccurs="0"/> </xs:sequence> </xs:complexType> </xs:element> </xs:choice> </xs:complexType> </xs:element> <xs:complexType name="AlbumType"> <xs:sequence> <xs:element name="AlbumName" type="xs:string"/> <xs:element name="ArtistName" type="xs:string"/> <xs:element name="Track" type="TrackType" maxOccurs="unbounded"/> </xs:sequence> <xs:attribute name="Label" type="xs:string" use="required"/> <xs:attribute name="RRP" type="xs:double"/> <xs:attribute name="ProductCode" use="required"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:length value="15"/> </xs:restriction> </xs:simpleType> </xs:attribute> </xs:complexType> <xs:complexType name="CompactDiskType"> <xs:sequence> <xs:element name="Title" type="xs:string" minOccurs="0"/> </xs:sequence> </xs:complexType> <xs:complexType name="TrackType"> <xs:sequence> <xs:element name="Title" type="xs:string"/> <xs:element name="Length" type="xs:duration"/> </xs:sequence> </xs:complexType> </xs:schema> |
Schema Diagrams |
|
AlbumType.vb |
Option Explicit On Option Strict On Imports System Imports System.Xml '********************************************************************************************** '* Copyright (c) 2001-2023 Liquid Technologies Limited. All rights reserved. '* See www.liquid-technologies.com for product details. '* '* Please see products End User License Agreement for distribution permissions. '* '* WARNING: THIS FILE IS GENERATED '* Changes made outside of ##HAND_CODED_BLOCK_START blocks will be overwritten '* '* Generation : by Liquid XML Data Binder 19.0.14.11049 '* Using Schema: MusicStore.xsd '********************************************************************************************** Namespace MusicStoreLib ''' <summary> ''' This class represents the ComplexType AlbumType ''' </summary> <LiquidTechnologies.Runtime.XmlObjectInfo(LiquidTechnologies.Runtime.XmlObjectBase.XmlElementGroupType.Sequence, _ LiquidTechnologies.Runtime.XmlObjectBase.XmlElementType.Element, _ "AlbumType", "", true, false, false)> _ Public Partial Class AlbumType Inherits MusicStoreLib.XmlCommonBase #Region "Constructors" ''' <summary> ''' Constructor for AlbumType ''' </summary> ''' <remarks> ''' The class is created with all the mandatory fields populated with the ''' default data. ''' All Collection object are created. ''' However any 1-n relationships (these are represented as collections) are ''' empty. To comply with the schema these must be populated before the xml ''' obtained from ToXml is valid against the schema MusicStore.xsd ''' </remarks> Public Sub New() _elementName = "AlbumType" Init() End Sub Public Sub New(ByVal elementName As String) _elementName = elementName Init() End Sub #End Region #Region "Initialization methods for the class" ''' <summary> ''' Initializes the class ''' </summary> ''' <remarks> ''' This creates all the mandatory fields (populated with the default data) ''' All Collection object are created. ''' However any 1-n relationships (these are represented as collections) are ''' empty. To comply with the schema these must be populated before the xml ''' obtained from ToXml is valid against the schema MusicStore.xsd. ''' </remarks> Protected Overrides Sub Init() MusicStoreLib.Registration.iRegistrationIndicator = 0 ' causes registration to take place _Label = "" _RRP = Nothing _ProductCode = "" _AlbumName = "" _ArtistName = "" _Track = new MusicStoreLib.XmlObjectCollection(Of MusicStoreLib.TrackType)("Track", "", 1, -1, false) ' ##HAND_CODED_BLOCK_START ID="Additional Inits"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS ' Add Additional initialization code here... ' ##HAND_CODED_BLOCK_END ID="Additional Inits"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS End Sub #End Region #Region "ICloneable Interface" ''' <summary> ''' Allows the class to be copied ''' </summary> ''' <remarks> ''' Performs a 'deep copy' of all the data in the class (and its children) ''' </remarks> Public Overrides Function Clone() As Object Dim newObject As New MusicStoreLib.AlbumType(_elementName) Dim o As Object newObject._Label = _Label newObject._RRP = _RRP newObject._ProductCode = _ProductCode newObject._AlbumName = _AlbumName newObject._ArtistName = _ArtistName For Each o In _Track newObject._Track.Add(CType(CType(o, MusicStoreLib.TrackType).Clone(), MusicStoreLib.TrackType)) Next o o = Nothing ' ##HAND_CODED_BLOCK_START ID="Additional clone"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS ' Add Additional clone code here... ' ##HAND_CODED_BLOCK_END ID="Additional clone"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS Return newObject End Function #End Region #Region "Member variables" Protected Overrides Readonly Property TargetNamespace() As String Get Return "" End Get End Property #Region "Attribute - Label" ''' <summary> ''' Represents a mandatory Attribute in the XML document ''' </summary> ''' <remarks> ''' This property is represented as an Attribute in the XML. ''' It is mandatory and therefore must be populated within the XML. ''' It is defaulted to "". ''' </remarks> <LiquidTechnologies.Runtime.AttributeInfoPrimitive("Label", "", LiquidTechnologies.Runtime.Conversions.ConversionType.type_string, Nothing, LiquidTechnologies.Runtime.WhitespaceUtils.WhitespaceRule.Preserve, "", -1, -1, "", "", "", "", -1, -1, -1, Nothing)> _ Public Property Label() As String Get Return _Label End Get Set(ByVal value As String) ' Apply whitespace rules appropriately value = LiquidTechnologies.Runtime.WhitespaceUtils.Preserve(value) _Label = value End Set End Property Protected _Label As String #End Region #Region "Attribute - RRP" ''' <summary> ''' Represents an optional Attribute in the XML document ''' </summary> ''' <remarks> ''' This property is represented as an Attribute in the XML. ''' It is optional, initially it is not valid. ''' </remarks> <LiquidTechnologies.Runtime.AttributeInfoPrimitive("RRP", "", True, LiquidTechnologies.Runtime.Conversions.ConversionType.type_r8, Nothing, LiquidTechnologies.Runtime.WhitespaceUtils.WhitespaceRule.Collapse, "", -1, -1, "", "", "", "", -1, -1, -1, Nothing)> _ Public Property RRP() As Double? Get Return _RRP End Get Set(ByVal value As Double?) If value Is Nothing Then _RRP = Nothing Else _RRP = value End If End Set End Property Protected _RRP As Double? #End Region #Region "Attribute - ProductCode" ''' <summary> ''' Represents a mandatory Attribute in the XML document ''' </summary> ''' <remarks> ''' This property is represented as an Attribute in the XML. ''' It is mandatory and therefore must be populated within the XML. ''' It is defaulted to "". ''' </remarks> <LiquidTechnologies.Runtime.AttributeInfoPrimitive("ProductCode", "", LiquidTechnologies.Runtime.Conversions.ConversionType.type_string, Nothing, LiquidTechnologies.Runtime.WhitespaceUtils.WhitespaceRule.Preserve, "", -1, -1, "", "", "", "", 15, -1, -1, Nothing)> _ Public Property ProductCode() As String Get Return _ProductCode End Get Set(ByVal value As String) ' Apply whitespace rules appropriately value = LiquidTechnologies.Runtime.WhitespaceUtils.Preserve(value) CheckAttributeRestriction(2, value) _ProductCode = value End Set End Property Protected _ProductCode As String #End Region #Region "Attribute - AlbumName" ''' <summary> ''' Represents a mandatory Element in the XML document ''' </summary> ''' <remarks> ''' This property is represented as an Element in the XML. ''' It is mandatory and therefore must be populated within the XML. ''' It is defaulted to "". ''' </remarks> <LiquidTechnologies.Runtime.ElementInfoSeqPrimMnd("AlbumName", "", Nothing, LiquidTechnologies.Runtime.Conversions.ConversionType.type_string, Nothing, LiquidTechnologies.Runtime.WhitespaceUtils.WhitespaceRule.Preserve, "", -1, -1, "", "", "", "", -1, -1, -1, Nothing)> _ Public Property AlbumName() As String Get Return _AlbumName End Get Set(ByVal value As String) ' Apply whitespace rules appropriately value = LiquidTechnologies.Runtime.WhitespaceUtils.Preserve(value) _AlbumName = value End Set End Property Protected _AlbumName As String #End Region #Region "Attribute - ArtistName" ''' <summary> ''' Represents a mandatory Element in the XML document ''' </summary> ''' <remarks> ''' This property is represented as an Element in the XML. ''' It is mandatory and therefore must be populated within the XML. ''' It is defaulted to "". ''' </remarks> <LiquidTechnologies.Runtime.ElementInfoSeqPrimMnd("ArtistName", "", Nothing, LiquidTechnologies.Runtime.Conversions.ConversionType.type_string, Nothing, LiquidTechnologies.Runtime.WhitespaceUtils.WhitespaceRule.Preserve, "", -1, -1, "", "", "", "", -1, -1, -1, Nothing)> _ Public Property ArtistName() As String Get Return _ArtistName End Get Set(ByVal value As String) ' Apply whitespace rules appropriately value = LiquidTechnologies.Runtime.WhitespaceUtils.Preserve(value) _ArtistName = value End Set End Property Protected _ArtistName As String #End Region #Region "Attribute - Track" ''' <summary> ''' A collection of Tracks ''' </summary> ''' <remarks> ''' This property is represented as an Element in the XML. ''' This collection may contain 1 to Many objects. ''' </remarks> <LiquidTechnologies.Runtime.ElementInfoSeqClsCol("Track", "", LiquidTechnologies.Runtime.XmlObjectBase.XmlElementType.Element)> _ Public Readonly Property Track() As MusicStoreLib.XmlObjectCollection(Of MusicStoreLib.TrackType) Get Return _Track End Get End Property Protected _Track As MusicStoreLib.XmlObjectCollection(Of MusicStoreLib.TrackType) #End Region #Region "Attribute - Namespace" Public Overrides Readonly Property [Namespace]() As String Get Return "" End Get End Property #End Region #Region "Attribute - GetBase" Public Overrides Function GetBase() As LiquidTechnologies.Runtime.XmlObjectBase Return Me End Function #End Region #End Region ' ##HAND_CODED_BLOCK_START ID="Additional Methods"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS ' Add Additional Methods and members here... ' ##HAND_CODED_BLOCK_END ID="Additional Methods"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS End Class End Namespace |
Error_.vb |
Option Explicit On Option Strict On Imports System Imports System.Xml '********************************************************************************************** '* Copyright (c) 2001-2023 Liquid Technologies Limited. All rights reserved. '* See www.liquid-technologies.com for product details. '* '* Please see products End User License Agreement for distribution permissions. '* '* WARNING: THIS FILE IS GENERATED '* Changes made outside of ##HAND_CODED_BLOCK_START blocks will be overwritten '* '* Generation : by Liquid XML Data Binder 19.0.14.11049 '* Using Schema: MusicStore.xsd '********************************************************************************************** Namespace MusicStoreLib ''' <summary> ''' This class represents the ComplexType Error ''' </summary> <LiquidTechnologies.Runtime.XmlObjectInfo(LiquidTechnologies.Runtime.XmlObjectBase.XmlElementGroupType.Sequence, _ LiquidTechnologies.Runtime.XmlObjectBase.XmlElementType.Element, _ "Error", "", true, false, false)> _ Public Partial Class Error_ Inherits MusicStoreLib.XmlCommonBase #Region "Constructors" ''' <summary> ''' Constructor for Error_ ''' </summary> ''' <remarks> ''' The class is created with all the mandatory fields populated with the ''' default data. ''' All Collection object are created. ''' However any 1-n relationships (these are represented as collections) are ''' empty. To comply with the schema these must be populated before the xml ''' obtained from ToXml is valid against the schema MusicStore.xsd ''' </remarks> Public Sub New() _elementName = "Error" Init() End Sub Public Sub New(ByVal elementName As String) _elementName = elementName Init() End Sub #End Region #Region "Initialization methods for the class" ''' <summary> ''' Initializes the class ''' </summary> ''' <remarks> ''' This creates all the mandatory fields (populated with the default data) ''' All Collection object are created. ''' However any 1-n relationships (these are represented as collections) are ''' empty. To comply with the schema these must be populated before the xml ''' obtained from ToXml is valid against the schema MusicStore.xsd. ''' </remarks> Protected Overrides Sub Init() MusicStoreLib.Registration.iRegistrationIndicator = 0 ' causes registration to take place _ErrorCode = 0 _ErrorDescription = "" _HelpFile = Nothing ' ##HAND_CODED_BLOCK_START ID="Additional Inits"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS ' Add Additional initialization code here... ' ##HAND_CODED_BLOCK_END ID="Additional Inits"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS End Sub #End Region #Region "ICloneable Interface" ''' <summary> ''' Allows the class to be copied ''' </summary> ''' <remarks> ''' Performs a 'deep copy' of all the data in the class (and its children) ''' </remarks> Public Overrides Function Clone() As Object Dim newObject As New MusicStoreLib.Error_(_elementName) Dim o As Object newObject._ErrorCode = _ErrorCode newObject._ErrorDescription = _ErrorDescription newObject._HelpFile = _HelpFile o = Nothing ' ##HAND_CODED_BLOCK_START ID="Additional clone"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS ' Add Additional clone code here... ' ##HAND_CODED_BLOCK_END ID="Additional clone"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS Return newObject End Function #End Region #Region "Member variables" Protected Overrides Readonly Property TargetNamespace() As String Get Return "" End Get End Property #Region "Attribute - ErrorCode" ''' <summary> ''' Represents a mandatory Element in the XML document ''' </summary> ''' <remarks> ''' This property is represented as an Element in the XML. ''' It is mandatory and therefore must be populated within the XML. ''' It is defaulted to 0. ''' </remarks> <LiquidTechnologies.Runtime.ElementInfoSeqPrimMnd("ErrorCode", "", Nothing, LiquidTechnologies.Runtime.Conversions.ConversionType.type_i4, Nothing, LiquidTechnologies.Runtime.WhitespaceUtils.WhitespaceRule.Collapse, "", -1, -1, "", "", "", "", -1, -1, -1, Nothing)> _ Public Property ErrorCode() As Integer Get Return _ErrorCode End Get Set(ByVal value As Integer) _ErrorCode = value End Set End Property Protected _ErrorCode As Integer #End Region #Region "Attribute - ErrorDescription" ''' <summary> ''' Represents a mandatory Element in the XML document ''' </summary> ''' <remarks> ''' This property is represented as an Element in the XML. ''' It is mandatory and therefore must be populated within the XML. ''' It is defaulted to "". ''' </remarks> <LiquidTechnologies.Runtime.ElementInfoSeqPrimMnd("ErrorDescription", "", Nothing, LiquidTechnologies.Runtime.Conversions.ConversionType.type_string, Nothing, LiquidTechnologies.Runtime.WhitespaceUtils.WhitespaceRule.Preserve, "", -1, -1, "", "", "", "", -1, -1, -1, Nothing)> _ Public Property ErrorDescription() As String Get Return _ErrorDescription End Get Set(ByVal value As String) ' Apply whitespace rules appropriately value = LiquidTechnologies.Runtime.WhitespaceUtils.Preserve(value) _ErrorDescription = value End Set End Property Protected _ErrorDescription As String #End Region #Region "Attribute - HelpFile" ''' <summary> ''' Represents an optional Element in the XML document ''' </summary> ''' <remarks> ''' This property is represented as an Element in the XML. ''' It is optional, initially it is not valid. ''' </remarks> <LiquidTechnologies.Runtime.ElementInfoSeqPrimOpt("HelpFile", "", True, Nothing, LiquidTechnologies.Runtime.Conversions.ConversionType.type_string, Nothing, LiquidTechnologies.Runtime.WhitespaceUtils.WhitespaceRule.Preserve, "", -1, -1, "", "", "", "", -1, -1, -1, Nothing)> _ Public Property HelpFile() As String Get Return _HelpFile End Get Set(ByVal value As String) If value Is Nothing Then _HelpFile = Nothing Else ' Apply whitespace rules appropriately value = LiquidTechnologies.Runtime.WhitespaceUtils.Preserve(value) _HelpFile = value End If End Set End Property Protected _HelpFile As String #End Region #Region "Attribute - Namespace" Public Overrides Readonly Property [Namespace]() As String Get Return "" End Get End Property #End Region #Region "Attribute - GetBase" Public Overrides Function GetBase() As LiquidTechnologies.Runtime.XmlObjectBase Return Me End Function #End Region #End Region ' ##HAND_CODED_BLOCK_START ID="Additional Methods"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS ' Add Additional Methods and members here... ' ##HAND_CODED_BLOCK_END ID="Additional Methods"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS End Class End Namespace |
PriceFilter.vb |
Option Explicit On Option Strict On Imports System Imports System.Xml '********************************************************************************************** '* Copyright (c) 2001-2023 Liquid Technologies Limited. All rights reserved. '* See www.liquid-technologies.com for product details. '* '* Please see products End User License Agreement for distribution permissions. '* '* WARNING: THIS FILE IS GENERATED '* Changes made outside of ##HAND_CODED_BLOCK_START blocks will be overwritten '* '* Generation : by Liquid XML Data Binder 19.0.14.11049 '* Using Schema: MusicStore.xsd '********************************************************************************************** Namespace MusicStoreLib ''' <summary> ''' This class represents the ComplexType PriceFilter ''' </summary> <LiquidTechnologies.Runtime.XmlObjectInfo(LiquidTechnologies.Runtime.XmlObjectBase.XmlElementGroupType.Sequence, _ LiquidTechnologies.Runtime.XmlObjectBase.XmlElementType.Element, _ "PriceFilter", "", true, false, false)> _ Public Partial Class PriceFilter Inherits MusicStoreLib.XmlCommonBase #Region "Constructors" ''' <summary> ''' Constructor for PriceFilter ''' </summary> ''' <remarks> ''' The class is created with all the mandatory fields populated with the ''' default data. ''' All Collection object are created. ''' However any 1-n relationships (these are represented as collections) are ''' empty. To comply with the schema these must be populated before the xml ''' obtained from ToXml is valid against the schema MusicStore.xsd ''' </remarks> Public Sub New() _elementName = "PriceFilter" Init() End Sub Public Sub New(ByVal elementName As String) _elementName = elementName Init() End Sub #End Region #Region "Initialization methods for the class" ''' <summary> ''' Initializes the class ''' </summary> ''' <remarks> ''' This creates all the mandatory fields (populated with the default data) ''' All Collection object are created. ''' However any 1-n relationships (these are represented as collections) are ''' empty. To comply with the schema these must be populated before the xml ''' obtained from ToXml is valid against the schema MusicStore.xsd. ''' </remarks> Protected Overrides Sub Init() MusicStoreLib.Registration.iRegistrationIndicator = 0 ' causes registration to take place _MinPrice = Nothing _MaxPrice = Nothing ' ##HAND_CODED_BLOCK_START ID="Additional Inits"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS ' Add Additional initialization code here... ' ##HAND_CODED_BLOCK_END ID="Additional Inits"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS End Sub #End Region #Region "ICloneable Interface" ''' <summary> ''' Allows the class to be copied ''' </summary> ''' <remarks> ''' Performs a 'deep copy' of all the data in the class (and its children) ''' </remarks> Public Overrides Function Clone() As Object Dim newObject As New MusicStoreLib.PriceFilter(_elementName) Dim o As Object newObject._MinPrice = _MinPrice newObject._MaxPrice = _MaxPrice o = Nothing ' ##HAND_CODED_BLOCK_START ID="Additional clone"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS ' Add Additional clone code here... ' ##HAND_CODED_BLOCK_END ID="Additional clone"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS Return newObject End Function #End Region #Region "Member variables" Protected Overrides Readonly Property TargetNamespace() As String Get Return "" End Get End Property #Region "Attribute - MinPrice" ''' <summary> ''' Represents an optional Element in the XML document ''' </summary> ''' <remarks> ''' This property is represented as an Element in the XML. ''' It is optional, initially it is not valid. ''' </remarks> <LiquidTechnologies.Runtime.ElementInfoSeqPrimOpt("MinPrice", "", True, Nothing, LiquidTechnologies.Runtime.Conversions.ConversionType.type_r8, Nothing, LiquidTechnologies.Runtime.WhitespaceUtils.WhitespaceRule.Collapse, "", -1, -1, "", "", "", "", -1, -1, -1, Nothing)> _ Public Property MinPrice() As Double? Get Return _MinPrice End Get Set(ByVal value As Double?) If value Is Nothing Then _MinPrice = Nothing Else _MinPrice = value End If End Set End Property Protected _MinPrice As Double? #End Region #Region "Attribute - MaxPrice" ''' <summary> ''' Represents an optional Element in the XML document ''' </summary> ''' <remarks> ''' This property is represented as an Element in the XML. ''' It is optional, initially it is not valid. ''' </remarks> <LiquidTechnologies.Runtime.ElementInfoSeqPrimOpt("MaxPrice", "", True, Nothing, LiquidTechnologies.Runtime.Conversions.ConversionType.type_r8, Nothing, LiquidTechnologies.Runtime.WhitespaceUtils.WhitespaceRule.Collapse, "", -1, -1, "", "", "", "", -1, -1, -1, Nothing)> _ Public Property MaxPrice() As Double? Get Return _MaxPrice End Get Set(ByVal value As Double?) If value Is Nothing Then _MaxPrice = Nothing Else _MaxPrice = value End If End Set End Property Protected _MaxPrice As Double? #End Region #Region "Attribute - Namespace" Public Overrides Readonly Property [Namespace]() As String Get Return "" End Get End Property #End Region #Region "Attribute - GetBase" Public Overrides Function GetBase() As LiquidTechnologies.Runtime.XmlObjectBase Return Me End Function #End Region #End Region ' ##HAND_CODED_BLOCK_START ID="Additional Methods"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS ' Add Additional Methods and members here... ' ##HAND_CODED_BLOCK_END ID="Additional Methods"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS End Class End Namespace |
Result.vb |
Option Explicit On Option Strict On Imports System Imports System.Xml '********************************************************************************************** '* Copyright (c) 2001-2023 Liquid Technologies Limited. All rights reserved. '* See www.liquid-technologies.com for product details. '* '* Please see products End User License Agreement for distribution permissions. '* '* WARNING: THIS FILE IS GENERATED '* Changes made outside of ##HAND_CODED_BLOCK_START blocks will be overwritten '* '* Generation : by Liquid XML Data Binder 19.0.14.11049 '* Using Schema: MusicStore.xsd '********************************************************************************************** Namespace MusicStoreLib ''' <summary> ''' This class represents the ComplexType Result ''' </summary> <LiquidTechnologies.Runtime.XmlObjectInfo(LiquidTechnologies.Runtime.XmlObjectBase.XmlElementGroupType.Sequence, _ LiquidTechnologies.Runtime.XmlObjectBase.XmlElementType.Element, _ "Result", "", true, false, false)> _ Public Partial Class Result Inherits MusicStoreLib.XmlCommonBase #Region "Constructors" ''' <summary> ''' Constructor for Result ''' </summary> ''' <remarks> ''' The class is created with all the mandatory fields populated with the ''' default data. ''' All Collection object are created. ''' However any 1-n relationships (these are represented as collections) are ''' empty. To comply with the schema these must be populated before the xml ''' obtained from ToXml is valid against the schema MusicStore.xsd ''' </remarks> Public Sub New() _elementName = "Result" Init() End Sub Public Sub New(ByVal elementName As String) _elementName = elementName Init() End Sub #End Region #Region "Initialization methods for the class" ''' <summary> ''' Initializes the class ''' </summary> ''' <remarks> ''' This creates all the mandatory fields (populated with the default data) ''' All Collection object are created. ''' However any 1-n relationships (these are represented as collections) are ''' empty. To comply with the schema these must be populated before the xml ''' obtained from ToXml is valid against the schema MusicStore.xsd. ''' </remarks> Protected Overrides Sub Init() MusicStoreLib.Registration.iRegistrationIndicator = 0 ' causes registration to take place _SearchDate = New LiquidTechnologies.Runtime.XmlDateTime(LiquidTechnologies.Runtime.XmlDateTime.DateType.date) _Product = new MusicStoreLib.XmlObjectCollection(Of MusicStoreLib.AlbumType)("Product", "", 0, -1, false) ' ##HAND_CODED_BLOCK_START ID="Additional Inits"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS ' Add Additional initialization code here... ' ##HAND_CODED_BLOCK_END ID="Additional Inits"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS End Sub #End Region #Region "ICloneable Interface" ''' <summary> ''' Allows the class to be copied ''' </summary> ''' <remarks> ''' Performs a 'deep copy' of all the data in the class (and its children) ''' </remarks> Public Overrides Function Clone() As Object Dim newObject As New MusicStoreLib.Result(_elementName) Dim o As Object newObject._SearchDate = CType(_SearchDate.Clone(), LiquidTechnologies.Runtime.XmlDateTime) For Each o In _Product newObject._Product.Add(CType(CType(o, MusicStoreLib.AlbumType).Clone(), MusicStoreLib.AlbumType)) Next o o = Nothing ' ##HAND_CODED_BLOCK_START ID="Additional clone"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS ' Add Additional clone code here... ' ##HAND_CODED_BLOCK_END ID="Additional clone"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS Return newObject End Function #End Region #Region "Member variables" Protected Overrides Readonly Property TargetNamespace() As String Get Return "" End Get End Property #Region "Attribute - SearchDate" ''' <summary> ''' Represents a mandatory Element in the XML document ''' </summary> ''' <remarks> ''' This property is represented as an Element in the XML. ''' It is mandatory and therefore must be populated within the XML. ''' It is defaulted to New LiquidTechnologies.Runtime.XmlDateTime(LiquidTechnologies.Runtime.XmlDateTime.DateType.date). ''' </remarks> <LiquidTechnologies.Runtime.ElementInfoSeqPrimMnd("SearchDate", "", Nothing, LiquidTechnologies.Runtime.Conversions.ConversionType.type_date, Nothing, LiquidTechnologies.Runtime.WhitespaceUtils.WhitespaceRule.Collapse, "", -1, -1, "", "", "", "", -1, -1, -1, Nothing)> _ Public Property SearchDate() As LiquidTechnologies.Runtime.XmlDateTime Get Return _SearchDate End Get Set(ByVal value As LiquidTechnologies.Runtime.XmlDateTime) _SearchDate.SetDateTime(value, _SearchDate.Type) End Set End Property Protected _SearchDate As LiquidTechnologies.Runtime.XmlDateTime #End Region #Region "Attribute - Product" ''' <summary> ''' A collection of Products ''' </summary> ''' <remarks> ''' This property is represented as an Element in the XML. ''' This collection may contain 0 to Many objects. ''' </remarks> <LiquidTechnologies.Runtime.ElementInfoSeqClsCol("Product", "", LiquidTechnologies.Runtime.XmlObjectBase.XmlElementType.Element)> _ Public Readonly Property Product() As MusicStoreLib.XmlObjectCollection(Of MusicStoreLib.AlbumType) Get Return _Product End Get End Property Protected _Product As MusicStoreLib.XmlObjectCollection(Of MusicStoreLib.AlbumType) #End Region #Region "Attribute - Namespace" Public Overrides Readonly Property [Namespace]() As String Get Return "" End Get End Property #End Region #Region "Attribute - GetBase" Public Overrides Function GetBase() As LiquidTechnologies.Runtime.XmlObjectBase Return Me End Function #End Region #End Region ' ##HAND_CODED_BLOCK_START ID="Additional Methods"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS ' Add Additional Methods and members here... ' ##HAND_CODED_BLOCK_END ID="Additional Methods"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS End Class End Namespace |
SearchRequest.vb |
Option Explicit On Option Strict On Imports System Imports System.Xml '********************************************************************************************** '* Copyright (c) 2001-2023 Liquid Technologies Limited. All rights reserved. '* See www.liquid-technologies.com for product details. '* '* Please see products End User License Agreement for distribution permissions. '* '* WARNING: THIS FILE IS GENERATED '* Changes made outside of ##HAND_CODED_BLOCK_START blocks will be overwritten '* '* Generation : by Liquid XML Data Binder 19.0.14.11049 '* Using Schema: MusicStore.xsd '********************************************************************************************** Namespace MusicStoreLib ''' <summary> ''' This class represents the Element SearchRequest ''' </summary> <LiquidTechnologies.Runtime.XmlObjectInfo(LiquidTechnologies.Runtime.XmlObjectBase.XmlElementGroupType.Sequence, _ LiquidTechnologies.Runtime.XmlObjectBase.XmlElementType.Element, _ "SearchRequest", "", true, false, false)> _ Public Partial Class SearchRequest Inherits MusicStoreLib.XmlCommonBase #Region "Constructors" ''' <summary> ''' Constructor for SearchRequest ''' </summary> ''' <remarks> ''' The class is created with all the mandatory fields populated with the ''' default data. ''' All Collection object are created. ''' However any 1-n relationships (these are represented as collections) are ''' empty. To comply with the schema these must be populated before the xml ''' obtained from ToXml is valid against the schema MusicStore.xsd ''' </remarks> Public Sub New() _elementName = "SearchRequest" Init() End Sub Public Sub New(ByVal elementName As String) _elementName = elementName Init() End Sub #End Region #Region "Initialization methods for the class" ''' <summary> ''' Initializes the class ''' </summary> ''' <remarks> ''' This creates all the mandatory fields (populated with the default data) ''' All Collection object are created. ''' However any 1-n relationships (these are represented as collections) are ''' empty. To comply with the schema these must be populated before the xml ''' obtained from ToXml is valid against the schema MusicStore.xsd. ''' </remarks> Protected Overrides Sub Init() MusicStoreLib.Registration.iRegistrationIndicator = 0 ' causes registration to take place _PriceFilter = new MusicStoreLib.PriceFilter("PriceFilter") _NameFilter = "" ' ##HAND_CODED_BLOCK_START ID="Additional Inits"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS ' Add Additional initialization code here... ' ##HAND_CODED_BLOCK_END ID="Additional Inits"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS End Sub #End Region #Region "ICloneable Interface" ''' <summary> ''' Allows the class to be copied ''' </summary> ''' <remarks> ''' Performs a 'deep copy' of all the data in the class (and its children) ''' </remarks> Public Overrides Function Clone() As Object Dim newObject As New MusicStoreLib.SearchRequest(_elementName) Dim o As Object newObject._PriceFilter = Nothing If Not _PriceFilter Is Nothing Then newObject._PriceFilter = CType(_PriceFilter.Clone(), MusicStoreLib.PriceFilter) End If newObject._NameFilter = _NameFilter o = Nothing ' ##HAND_CODED_BLOCK_START ID="Additional clone"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS ' Add Additional clone code here... ' ##HAND_CODED_BLOCK_END ID="Additional clone"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS Return newObject End Function #End Region #Region "Member variables" Protected Overrides Readonly Property TargetNamespace() As String Get Return "" End Get End Property #Region "Attribute - PriceFilter" ''' <summary> ''' Represents a mandatory Element in the XML document ''' </summary> ''' <remarks> ''' This property is represented as an Element in the XML. ''' It is mandatory and therefore must be populated within the XML. ''' If this property is set, then the object will be COPIED. If the property is set to Nothing an exception is raised. ''' </remarks> <LiquidTechnologies.Runtime.ElementInfoSeqClsMnd("PriceFilter", "", LiquidTechnologies.Runtime.XmlObjectBase.XmlElementType.Element, GetType(MusicStoreLib.PriceFilter), false)> _ Public Property PriceFilter() As MusicStoreLib.PriceFilter Get Return _PriceFilter End Get Set(ByVal value As MusicStoreLib.PriceFilter) Throw_IfPropertyIsNull(value, "PriceFilter") If Not value Is Nothing Then SetElementName(value, "PriceFilter") End If _PriceFilter = value End Set End Property Protected _PriceFilter As MusicStoreLib.PriceFilter #End Region #Region "Attribute - NameFilter" ''' <summary> ''' Represents a mandatory Element in the XML document ''' </summary> ''' <remarks> ''' This property is represented as an Element in the XML. ''' It is mandatory and therefore must be populated within the XML. ''' It is defaulted to "". ''' </remarks> <LiquidTechnologies.Runtime.ElementInfoSeqPrimMnd("NameFilter", "", Nothing, LiquidTechnologies.Runtime.Conversions.ConversionType.type_string, Nothing, LiquidTechnologies.Runtime.WhitespaceUtils.WhitespaceRule.Preserve, "", -1, -1, "", "", "", "", -1, -1, -1, Nothing)> _ Public Property NameFilter() As String Get Return _NameFilter End Get Set(ByVal value As String) ' Apply whitespace rules appropriately value = LiquidTechnologies.Runtime.WhitespaceUtils.Preserve(value) _NameFilter = value End Set End Property Protected _NameFilter As String #End Region #Region "Attribute - Namespace" Public Overrides Readonly Property [Namespace]() As String Get Return "" End Get End Property #End Region #Region "Attribute - GetBase" Public Overrides Function GetBase() As LiquidTechnologies.Runtime.XmlObjectBase Return Me End Function #End Region #End Region ' ##HAND_CODED_BLOCK_START ID="Additional Methods"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS ' Add Additional Methods and members here... ' ##HAND_CODED_BLOCK_END ID="Additional Methods"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS End Class End Namespace |
SearchResponse.vb |
Option Explicit On Option Strict On Imports System Imports System.Xml '********************************************************************************************** '* Copyright (c) 2001-2023 Liquid Technologies Limited. All rights reserved. '* See www.liquid-technologies.com for product details. '* '* Please see products End User License Agreement for distribution permissions. '* '* WARNING: THIS FILE IS GENERATED '* Changes made outside of ##HAND_CODED_BLOCK_START blocks will be overwritten '* '* Generation : by Liquid XML Data Binder 19.0.14.11049 '* Using Schema: MusicStore.xsd '********************************************************************************************** Namespace MusicStoreLib ''' <summary> ''' This class represents the Element SearchResponse ''' </summary> <LiquidTechnologies.Runtime.XmlObjectInfo(LiquidTechnologies.Runtime.XmlObjectBase.XmlElementGroupType.Choice, _ LiquidTechnologies.Runtime.XmlObjectBase.XmlElementType.Element, _ "SearchResponse", "", true, false, false)> _ Public Partial Class SearchResponse Inherits MusicStoreLib.XmlCommonBase #Region "Constructors" ''' <summary> ''' Constructor for SearchResponse ''' </summary> ''' <remarks> ''' The class is created with all the mandatory fields populated with the ''' default data. ''' All Collection object are created. ''' However any 1-n relationships (these are represented as collections) are ''' empty. To comply with the schema these must be populated before the xml ''' obtained from ToXml is valid against the schema MusicStore.xsd ''' </remarks> Public Sub New() _elementName = "SearchResponse" Init() End Sub Public Sub New(ByVal elementName As String) _elementName = elementName Init() End Sub #End Region #Region "Initialization methods for the class" ''' <summary> ''' Initializes the class ''' </summary> ''' <remarks> ''' This creates all the mandatory fields (populated with the default data) ''' All Collection object are created. ''' However any 1-n relationships (these are represented as collections) are ''' empty. To comply with the schema these must be populated before the xml ''' obtained from ToXml is valid against the schema MusicStore.xsd. ''' </remarks> Protected Overrides Sub Init() MusicStoreLib.Registration.iRegistrationIndicator = 0 ' causes registration to take place _Result = Nothing _Error = Nothing _validElement = "" ' ##HAND_CODED_BLOCK_START ID="Additional Inits"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS ' Add Additional initialization code here... ' ##HAND_CODED_BLOCK_END ID="Additional Inits"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS End Sub Protected Sub ClearChoice(ByVal selectedElement As String) _Result = Nothing _Error = Nothing _validElement = selectedElement End Sub #End Region #Region "ICloneable Interface" ''' <summary> ''' Allows the class to be copied ''' </summary> ''' <remarks> ''' Performs a 'deep copy' of all the data in the class (and its children) ''' </remarks> Public Overrides Function Clone() As Object Dim newObject As New MusicStoreLib.SearchResponse(_elementName) Dim o As Object newObject._Result = Nothing if Not _Result Is Nothing Then newObject._Result = CType(_Result.Clone(), MusicStoreLib.Result) End If newObject._Error = Nothing if Not _Error Is Nothing Then newObject._Error = CType(_Error.Clone(), MusicStoreLib.Error_) End If o = Nothing newObject._validElement = _validElement ' ##HAND_CODED_BLOCK_START ID="Additional clone"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS ' Add Additional clone code here... ' ##HAND_CODED_BLOCK_END ID="Additional clone"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS Return newObject End Function #End Region #Region "Member variables" Protected Overrides Readonly Property TargetNamespace() As String Get Return "" End Get End Property #Region "Attribute - Result" ''' <summary> ''' Represents an optional Element in the XML document ''' </summary> ''' <remarks> ''' This property is represented as an Element in the XML. ''' It is optional, initially it is Nothing. ''' Only one Element within this class may be set at a time, setting this property when another element is already set will raise an exception. setting this property to Nothing will allow another element to be selected ''' </remarks> <LiquidTechnologies.Runtime.ElementInfoChoiceClsOpt("Result", "", LiquidTechnologies.Runtime.XmlObjectBase.XmlElementType.Element, GetType(MusicStoreLib.Result))> _ Public Property Result() As MusicStoreLib.Result Get Return _Result End Get Set(ByVal value As MusicStoreLib.Result) ' The class represents a choice, so prevent more than one element from being selected If value Is Nothing Then ClearChoice("") Else ClearChoice("Result") ' remove selection If value Is Nothing Then _Result = Nothing Else SetElementName(value, "Result") _Result = value End If End Set End Property Protected _Result As MusicStoreLib.Result #End Region #Region "Attribute - Error" ''' <summary> ''' Represents an optional Element in the XML document ''' </summary> ''' <remarks> ''' This property is represented as an Element in the XML. ''' It is optional, initially it is Nothing. ''' Only one Element within this class may be set at a time, setting this property when another element is already set will raise an exception. setting this property to Nothing will allow another element to be selected ''' </remarks> <LiquidTechnologies.Runtime.ElementInfoChoiceClsOpt("Error", "", LiquidTechnologies.Runtime.XmlObjectBase.XmlElementType.Element, GetType(MusicStoreLib.Error_))> _ Public Property Error_() As MusicStoreLib.Error_ Get Return _Error End Get Set(ByVal value As MusicStoreLib.Error_) ' The class represents a choice, so prevent more than one element from being selected If value Is Nothing Then ClearChoice("") Else ClearChoice("Error_") ' remove selection If value Is Nothing Then _Error = Nothing Else SetElementName(value, "Error") _Error = value End If End Set End Property Protected _Error As MusicStoreLib.Error_ #End Region Public Readonly Property ChoiceSelectedElement() As String Get Return _validElement End Get End Property Protected _validElement As String #Region "Attribute - Namespace" Public Overrides Readonly Property [Namespace]() As String Get Return "" End Get End Property #End Region #Region "Attribute - GetBase" Public Overrides Function GetBase() As LiquidTechnologies.Runtime.XmlObjectBase Return Me End Function #End Region #End Region ' ##HAND_CODED_BLOCK_START ID="Additional Methods"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS ' Add Additional Methods and members here... ' ##HAND_CODED_BLOCK_END ID="Additional Methods"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS End Class End Namespace |
TrackType.vb |
Option Explicit On Option Strict On Imports System Imports System.Xml '********************************************************************************************** '* Copyright (c) 2001-2023 Liquid Technologies Limited. All rights reserved. '* See www.liquid-technologies.com for product details. '* '* Please see products End User License Agreement for distribution permissions. '* '* WARNING: THIS FILE IS GENERATED '* Changes made outside of ##HAND_CODED_BLOCK_START blocks will be overwritten '* '* Generation : by Liquid XML Data Binder 19.0.14.11049 '* Using Schema: MusicStore.xsd '********************************************************************************************** Namespace MusicStoreLib ''' <summary> ''' This class represents the ComplexType TrackType ''' </summary> <LiquidTechnologies.Runtime.XmlObjectInfo(LiquidTechnologies.Runtime.XmlObjectBase.XmlElementGroupType.Sequence, _ LiquidTechnologies.Runtime.XmlObjectBase.XmlElementType.Element, _ "TrackType", "", true, false, false)> _ Public Partial Class TrackType Inherits MusicStoreLib.XmlCommonBase #Region "Constructors" ''' <summary> ''' Constructor for TrackType ''' </summary> ''' <remarks> ''' The class is created with all the mandatory fields populated with the ''' default data. ''' All Collection object are created. ''' However any 1-n relationships (these are represented as collections) are ''' empty. To comply with the schema these must be populated before the xml ''' obtained from ToXml is valid against the schema MusicStore.xsd ''' </remarks> Public Sub New() _elementName = "TrackType" Init() End Sub Public Sub New(ByVal elementName As String) _elementName = elementName Init() End Sub #End Region #Region "Initialization methods for the class" ''' <summary> ''' Initializes the class ''' </summary> ''' <remarks> ''' This creates all the mandatory fields (populated with the default data) ''' All Collection object are created. ''' However any 1-n relationships (these are represented as collections) are ''' empty. To comply with the schema these must be populated before the xml ''' obtained from ToXml is valid against the schema MusicStore.xsd. ''' </remarks> Protected Overrides Sub Init() MusicStoreLib.Registration.iRegistrationIndicator = 0 ' causes registration to take place _Title = "" _Length = New LiquidTechnologies.Runtime.XmlDateTimeSpan() ' ##HAND_CODED_BLOCK_START ID="Additional Inits"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS ' Add Additional initialization code here... ' ##HAND_CODED_BLOCK_END ID="Additional Inits"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS End Sub #End Region #Region "ICloneable Interface" ''' <summary> ''' Allows the class to be copied ''' </summary> ''' <remarks> ''' Performs a 'deep copy' of all the data in the class (and its children) ''' </remarks> Public Overrides Function Clone() As Object Dim newObject As New MusicStoreLib.TrackType(_elementName) Dim o As Object newObject._Title = _Title newObject._Length = CType(_Length.Clone(), LiquidTechnologies.Runtime.XmlDateTimeSpan) o = Nothing ' ##HAND_CODED_BLOCK_START ID="Additional clone"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS ' Add Additional clone code here... ' ##HAND_CODED_BLOCK_END ID="Additional clone"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS Return newObject End Function #End Region #Region "Member variables" Protected Overrides Readonly Property TargetNamespace() As String Get Return "" End Get End Property #Region "Attribute - Title" ''' <summary> ''' Represents a mandatory Element in the XML document ''' </summary> ''' <remarks> ''' This property is represented as an Element in the XML. ''' It is mandatory and therefore must be populated within the XML. ''' It is defaulted to "". ''' </remarks> <LiquidTechnologies.Runtime.ElementInfoSeqPrimMnd("Title", "", Nothing, LiquidTechnologies.Runtime.Conversions.ConversionType.type_string, Nothing, LiquidTechnologies.Runtime.WhitespaceUtils.WhitespaceRule.Preserve, "", -1, -1, "", "", "", "", -1, -1, -1, Nothing)> _ Public Property Title() As String Get Return _Title End Get Set(ByVal value As String) ' Apply whitespace rules appropriately value = LiquidTechnologies.Runtime.WhitespaceUtils.Preserve(value) _Title = value End Set End Property Protected _Title As String #End Region #Region "Attribute - Length" ''' <summary> ''' Represents a mandatory Element in the XML document ''' </summary> ''' <remarks> ''' This property is represented as an Element in the XML. ''' It is mandatory and therefore must be populated within the XML. ''' It is defaulted to New LiquidTechnologies.Runtime.XmlDateTimeSpan(). ''' </remarks> <LiquidTechnologies.Runtime.ElementInfoSeqPrimMnd("Length", "", Nothing, LiquidTechnologies.Runtime.Conversions.ConversionType.type_duration, Nothing, LiquidTechnologies.Runtime.WhitespaceUtils.WhitespaceRule.Collapse, "", -1, -1, "", "", "", "", -1, -1, -1, Nothing)> _ Public Property Length() As LiquidTechnologies.Runtime.XmlDateTimeSpan Get Return _Length End Get Set(ByVal value As LiquidTechnologies.Runtime.XmlDateTimeSpan) _Length = value End Set End Property Protected _Length As LiquidTechnologies.Runtime.XmlDateTimeSpan #End Region #Region "Attribute - Namespace" Public Overrides Readonly Property [Namespace]() As String Get Return "" End Get End Property #End Region #Region "Attribute - GetBase" Public Overrides Function GetBase() As LiquidTechnologies.Runtime.XmlObjectBase Return Me End Function #End Region #End Region ' ##HAND_CODED_BLOCK_START ID="Additional Methods"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS ' Add Additional Methods and members here... ' ##HAND_CODED_BLOCK_END ID="Additional Methods"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS End Class End Namespace |
Main Menu | Samples List |