public static bool ValidateCaseKey(object obj, ModelProperty casesProp, Type genericType, out string reason) { reason = string.Empty; string key = GenericFlowSwitchHelper.GetString(obj, genericType); if (GenericFlowSwitchHelper.CheckEquality(obj, genericType)) { if (GenericFlowSwitchHelper.ContainsCaseKey(casesProp, obj)) { reason = string.Format(CultureInfo.CurrentCulture, SR.DuplicateCaseKey, key); return(false); } return(true); } else { reason = string.Format(CultureInfo.CurrentUICulture, SR.EqualityError, genericType.Name); return(false); } }