Public Shared Function SetPortStopBits(ByVal defaultPortStopBits As StopBits) As StopBits
Dim newStopBits As String
Console.WriteLine("Available Stop Bits options:")
Dim s As String
For Each s In [Enum].GetNames(GetType(StopBits))
Console.WriteLine(" {0}", s)
Next s
Console.Write("Stop Bits({0}):", defaultPortStopBits.ToString())
newStopBits = Console.ReadLine()
If newStopBits = "" Then
newStopBits = defaultPortStopBits.ToString()
End If
Return CType([Enum].Parse(GetType(StopBits), newStopBits), StopBits)
End Function