private TransactionMode ObtainTransactionMode(Type implementation, MethodInfo method, string mode)
{
if (mode == null)
{
return TransactionMode.Unspecified;
}
try
{
return (TransactionMode)Enum.Parse(typeof(TransactionMode), mode, true);
}
catch (Exception)
{
String[] values = (String[])Enum.GetValues(typeof(TransactionMode));
String message = String.Format("The configuration for the class {0}, " +
"method {1}, has specified {2} on {3} attribute which is not supported. " +
"The possible values are {4}",
implementation.FullName, method.Name, mode, TransactionModeAtt, String.Join(", ", values));
throw new FacilityException(message);
}
}