I have a code in C# (.NET 2.0), where I call a method with an input Enum, but I cannot manage to make it work.
I have a compile error in the method isAnOptionalBooleanValue:
public static bool isAnOptionalBooleanValue(Status status, String parameterName, Object parameter)
{
return isAnOptionalValidValue(status, parameterName, parameter, UtilConstants.BooleanValues);
}
public static bool isAnOptionalValidValue(Status status, String parameterName, Object parameter, Enum setOfValues)
{
....
}
In other class:
public class UtilConstants
{
public enum BooleanValues
{
TRUE, FALSE
}
}
This class exists because the boolean value comes as an input String from other system, so I pass it as an Object and translate it to a Boolean from my Enum class.
The error it returns is the following: "UtilConstants.BooleanValues' is a 'type', which is not valid in the given context" with the error in the return isAnOptionalValidValue(...) line.
But I don't see how to fix it. Changing it by:
return isAnOptionalValidValue(status, parameterName, parameter, typeof(UtilConstants.BooleanValues));
does not work either.
Any ideas? Thank you for your help in advance!
bool?!isAnOptionalValidValue.