One of the requirements of DLNA is to add the following XML tag to UPNP device description and service SCPD XML.
Currently there is no way for me to insert this XML tag into either of the xml documents.
In order to make my UPNP device and services I subclass both DvDevice and DvService. I was wondering if a virtual method could be put into each of these classes, such that I could override them and insert whatever into the XML.
Something like this...
I could then do the following...
Hope that makes sense. Any other ideas are of course welcome.
Code:
<dlna:X_DLNADOC xmlns:dlna="urn:schemas-dlna-org:device-1-0">DMR-1.50</dlna:X_DLNADOC>
Currently there is no way for me to insert this XML tag into either of the xml documents.
In order to make my UPNP device and services I subclass both DvDevice and DvService. I was wondering if a virtual method could be put into each of these classes, such that I could override them and insert whatever into the XML.
Something like this...
Code:
class DvDevice {
(BLAH)
internal void AddDeviceDescriptionsRecursive(XmlWriter writer, EndpointConfiguration config, CultureInfo culture)
{
(BLAH)
AddAdditionalDeviceDescriptions(writer, config, culture);
(BLAH)
}
protected virtual void AddAdditionalDeviceDescriptions(XmlWriter writer, EndpointConfiguration config, CultureInfo culture)
{
// Nothing to do here for DvDevice, but could be overriden by a subclass.
}
}
I could then do the following...
Code:
class UPnPMediaServerDevice : DvDevice {
(BLAH)
protected override void AddAdditionalDeviceDescriptions(XmlWriter writer, EndpointConfiguration config, CultureInfo culture)
{
// Add DLNA specific Element.
writer.WriteElementString("dlna", "X_DLNADOC", "urn:schemas-dlna-org:device-1-0", "DMR-1.50");
}
(BLAH)
}
Hope that makes sense. Any other ideas are of course welcome.