Description
Returns, as DataContent, the value of the attribute attributeName of the object obj.
Syntax
dim i = GetDataContent(obj, attributeName) |
obj
the object, to read the attribute attributeName from
attributeName
the name of the attribute to be read from the object obj.
Code
<Extension()> _
Public Function GetDataContent(ByVal obj As IGenericAttrObj, ByVal attributeName As String) As DataContent
Dim value As Object
Dim found As Boolean
Dim dataId As Integer
value = GetAttributeBase(obj, attributeName, found)
If Not found Or value Is Nothing Then
Return Nothing
End If
dataId = CType(value, Integer)
Dim data As DataContentDesc
data = obj.GetDataAttribute(attributeName, dataId)
Return New DataContent(data) 'return always a valid object
End Function
Examples
Return GetDataContent(obj, "thumbnail")
See also
GetString, GetBoolean, GetDecimal, GetDate, GetXmlDocument, GetDataContent