Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # All of the handle* functions are defined elsewhere in the code.
- # Calls to dispatcher are made like `TYPE_HANDLERS[type(dat)](name, dat)`
- TYPE_HANDLERS = {dict: handleDict, list: handleList, str: handleStr, int: handleInt}
- Private Delegate Function handleDelegate(ByVal name As String, ByVal dat As Object) As String
- Function ParseDataIntoXML(ByVal name As String, ByVal dat As Object) As String
- Dim myDelegate As handleDelegate
- Select Case dat.GetType
- Case GetType(Dictionary(Of Object, Object))
- myDelegate = AddressOf handleDict
- Case GetType(ArrayList)
- myDelegate = AddressOf handleList
- Case GetType(String)
- myDelegate = AddressOf handleStr
- Case GetType(Integer)
- myDelegate = AddressOf handleInt
- End Select
- Return myDelegate(name, dat)
- End Function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement