28 lines
895 B
C#
28 lines
895 B
C#
namespace Common.Hardware.Ports
|
|
{
|
|
using System;
|
|
using System.IO.Ports;
|
|
|
|
public struct SerialPortParity
|
|
{
|
|
private readonly Parity value;
|
|
|
|
private SerialPortParity(Parity value)
|
|
=> this.value = value;
|
|
|
|
public override String ToString()
|
|
=> this.value.ToString();
|
|
|
|
public static readonly SerialPortParity None = Parity.None;
|
|
public static readonly SerialPortParity Odd = Parity.Odd;
|
|
public static readonly SerialPortParity Even = Parity.Even;
|
|
public static readonly SerialPortParity Mark = Parity.Mark;
|
|
public static readonly SerialPortParity Space = Parity.Space;
|
|
|
|
public static implicit operator SerialPortParity(Parity parity)
|
|
=> new SerialPortParity(parity);
|
|
|
|
public static implicit operator Parity(SerialPortParity parity)
|
|
=> parity.value;
|
|
}
|
|
} |