DataDirect XML Converters 5.0 Send comments on this topic.
GetEntity Method
See Also 
DDTek.XmlConverter Namespace > ConverterResolver Class : GetEntity Method




absoluteUri
An absolute Uri
role
Specifies whether the returned object will be used to read data or write data. The value must be either null or OUTPUT_ROLE If the value is null, then INPUT_ROLE will be assumed.
ofObjectToReturn
Must be one of null, typeof(System.IO.Stream), typeof(System.Xml.XmlReader) or typeof(System.Xml.XmlWriter). If the value is null, then typeof(System.IO.Stream) will be assumed.
Maps a Uri to an object containing the actual resource data. The caller may then read the data from the object or, possibly, write data to the object

Syntax

Visual Basic (Declaration) 
Public Overrides Function GetEntity( _
   ByVal absoluteUri As Uri, _
   ByVal role As String, _
   ByVal ofObjectToReturn As Type _
) As Object
Visual Basic (Usage)Copy Code
Dim instance As ConverterResolver
Dim absoluteUri As Uri
Dim role As String
Dim ofObjectToReturn As Type
Dim value As Object
 
value = instance.GetEntity(absoluteUri, role, ofObjectToReturn)
C# 
public override object GetEntity( 
   Uri absoluteUri,
   string role,
   Type ofObjectToReturn
)
Managed Extensions for C++ 
public: Object* GetEntity( 
   Uri* absoluteUri,
   string* role,
   Type* ofObjectToReturn
) override 
C++/CLI 
public:
Object^ GetEntity( 
   Uri^ absoluteUri,
   String^ role,
   Type^ ofObjectToReturn
) override 

Parameters

absoluteUri
An absolute Uri
role
Specifies whether the returned object will be used to read data or write data. The value must be either null or OUTPUT_ROLE If the value is null, then INPUT_ROLE will be assumed.
ofObjectToReturn
Must be one of null, typeof(System.IO.Stream), typeof(System.Xml.XmlReader) or typeof(System.Xml.XmlWriter). If the value is null, then typeof(System.IO.Stream) will be assumed.

Remarks

To read data from the Uri as a Stream, use:
Stream obj = (Stream)GetEntity(uri, null, null);

To write data to the Uri with a Stream, use:
Stream obj = (Stream)GetEntity(uri, ConverterResolver.OUTPUT_ROLE, null);

To read data from the Uri as an XmlReader, use:
XmlReader obj = (XmlReader)GetEntity(uri, null, typeof(XmlReader));

To write data to the Uri as an XmlWriter, use:
XmlWriter obj = (XmlWriter)GetEntity(uri, null, typeof(XmlWriter));

OUTPUT_ROLE and INPUT_ROLE are implementation specific values for the DDTek.XmlConverters\ namespace. They should not be used in situations where the fallback resolver will be required.

Similarly, if the fallback resolver does not support typeof XmlReader or XmlWriter for the Type parameter, then they should not be used in situations where the fallback resolver will be required.

Requirements

Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

© 2009 All Rights Reserved.