private static IConnection ConnectionFactory(ConnectionType type, string name, IDictionary <string, object> creationData) { IConnection connection = null; switch (type) { case ConnectionType.Serial: connection = SerialPortConnection.Create(creationData); break; case ConnectionType.NamedPipe: connection = NamedPipeConnection.Create(creationData); break; default: break; } return(connection); }
/// <inheritdoc/> public void Dispose() { _port.ExitInUse(); _port = null; }
/// <summary> /// Initializes a new instance of the <see cref="INTV.Shared.Model.Device.SerialPortConnection+PortInUse"/> class. /// </summary> /// <param name="port">The serial port being marked for use.</param> public PortInUse(SerialPortConnection port) { _port = port; }