I am using an enum that was created in c#:
public enum ParamChildKey
{
[EnumMember(Value = "SYS")]
System,
[EnumMember(Value = "GAT")]
Gate,
[EnumMember(Value = "CRT")]
Create,
[EnumMember(Value = "FLT")]
Fault,
}
I am writing code in vb.net and have a vb.net String, say "CRT" that I am trying to match up with its enum so I can pass the enum into a function.
When I write ParamChildKey.Create.ToValue I get a string value of "CRT" however when I use [Enum].GetValues it returns the integer index of each enum, "2" in this case.
My question is how do I get the enum by matching a string value to it so I can pass the enum into a function? So if I have a string value of "CRT" how do I get ParamChildKey.Create from the "CRT" string value? In this example I will be passing in ParamChildKey.Create into the function below.
GetParameterValue(paramName As Integer, Optional paramChildKey As ParamChildKey = ParamChildKey.System)