Show / Hide Table of Contents

Class DeviceStubExporter

Manages the exporting of stubbed devices and factories.

Inheritance
System.Object
DeviceStubExporter
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Phoenix.Test.DeviceMockSystem
Assembly: Phoenix.Test.Infrastructure.dll
Syntax
public class DeviceStubExporter

Methods

View Source

AddFactoryCapabilityStub(String, Type, Object)

Adds a interface stub to the device factory capability interface mapping.

Declaration
public void AddFactoryCapabilityStub(string deviceName, Type interfaceType, object interfaceStub)
Parameters
Type Name Description
System.String deviceName

The name of the device.

System.Type interfaceType

The interface type to stub.

System.Object interfaceStub

The stub object to return.

View Source

CreateDeviceInstance(String, IPAddress, String, String, String, String, Nullable<Guid>)

Creates an instance of the device of the given factory name.

Declaration
public IDevice CreateDeviceInstance(string deviceName, IPAddress address = null, string name = null, string alias = null, string configurationType = null, string configuration = null, Guid? phoenixId = null)
Parameters
Type Name Description
System.String deviceName

The name of the device.

System.Net.IPAddress address

The IP Address of the device.

System.String name

The name of the device if known.

System.String alias

The alias of the device if known.

System.String configurationType

The device configuration type.

System.String configuration

The device configuration.

System.Nullable<System.Guid> phoenixId

The device id.

Returns
Type Description
IDevice

The IDevice that was created with interface mappings if set.

View Source

GetFactoryInterface<T>(String)

Returns the interface requested for the named device.

Declaration
public T GetFactoryInterface<T>(string deviceName)
    where T : class
Parameters
Type Name Description
System.String deviceName

The name of the device.

Returns
Type Description
T

The interface if it is implemented or null if not implemented.

Type Parameters
Name Description
T

The interface that is being requested.

View Source

HasFactoryInterface<T>(String)

Checks to see if this named device implements the specific interface.

Declaration
public bool HasFactoryInterface<T>(string deviceName)
Parameters
Type Name Description
System.String deviceName

The name of the device.

Returns
Type Description
System.Boolean

True if it is implemented, false otherwise.

Type Parameters
Name Description
T

The interface to check for.

View Source

IsFactoryCapable(String, Type[])

Determines if this named device implements the specified interface types.

Declaration
public bool IsFactoryCapable(string deviceName, Type[] interfaceTypes)
Parameters
Type Name Description
System.String deviceName

The name of the device.

System.Type[] interfaceTypes

A list of the interfaces to check.

Returns
Type Description
System.Boolean

True if the object implements all of the interfaces, false otherwise.

View Source

RegisterDeviceFactory(String)

Registers a device factory with the system.

Declaration
public void RegisterDeviceFactory(string deviceName)
Parameters
Type Name Description
System.String deviceName

The name of the device being registered.

View Source

RegisterDeviceWithFactory(String, Type)

Registers a device with a factory so that it is created upon request.

Declaration
public void RegisterDeviceWithFactory(string deviceName, Type deviceType)
Parameters
Type Name Description
System.String deviceName

The name of the device to register the type for.

System.Type deviceType

The type to create as an IDevice.

View Source

RegisterDeviceWithFactory(String, Type, Dictionary<Type, Object>)

Registers a device with a factory so that it is created upon request.

Declaration
public void RegisterDeviceWithFactory(string deviceName, Type deviceType, Dictionary<Type, object> deviceInterfaceMap)
Parameters
Type Name Description
System.String deviceName

The name of the device to register the type for.

System.Type deviceType

The type to create as an IDevice.

System.Collections.Generic.Dictionary<System.Type, System.Object> deviceInterfaceMap

The capability interface mapping to use for all devices of this type.

  • View Source
In This Article
Back to top Generated by DocFX