Public Shared Function SetPortParity(ByVal defaultPortParity As Parity) As Parity
Dim newParity As String
Console.WriteLine("Available Parity options:")
Dim s As String
For Each s In [Enum].GetNames(GetType(Parity))
Console.WriteLine(" {0}", s)
Next s
Console.Write("Parity({0}):", defaultPortParity.ToString())
newparity = Console.ReadLine()
If newparity = "" Then
newparity = defaultPortParity.ToString()
End If
Return CType([Enum].Parse(GetType(Parity), newParity), Parity)
End Function