Method ToRootDevice
ToRootDevice(SsdpDevice)
Returns the root device associated with a device instance derived from SsdpDevice.
Declaration
public static SsdpRootDevice ToRootDevice(this SsdpDevice device)
Parameters
Type | Name | Description |
---|---|---|
SsdpDevice | device | The device instance to find the SsdpRootDevice for. |
Returns
Type | Description |
---|---|
SsdpRootDevice | The SsdpRootDevice instance associated with the device instance specified, or null otherwise. |
Remarks
The device
must be or inherit from SsdpRootDevice or SsdpEmbeddedDevice, otherwise an System.InvalidCastException will occur.
May return null if the device
instance is an embedded device not yet associated with a SsdpRootDevice instance yet.
If device
is an instance of SsdpRootDevice (or derives from it), returns the same instance cast to SsdpRootDevice.
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | Thrown if |
System.InvalidCastException | Thrown if |