Class SsdpDeviceExtensions
Extensions for SsdpDevice and derived types.
Inheritance
System.Object
SsdpDeviceExtensions
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Rssdp
Assembly: cs.temp.dll.dll
Syntax
public static class SsdpDeviceExtensions
Methods
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 |