public ModelClientValidationRequiredConditionalRule(string otherPropertyName, string type, IEnumerable<object> conditionValues, bool any, ValidationCompareOperator compareOperator, string errorMessage)
        {
            ErrorMessage = errorMessage;
            ValidationType = RuleName;

            ValidationParameters.Add("otherprop", otherPropertyName);
            ValidationParameters.Add("type", type);
            ValidationParameters.Add("operator", compareOperator.GetJavascriptOperator());
            ValidationParameters.Add("any", any.ToString(CultureInfo.InvariantCulture).ToLowerInvariant());
            ValidationParameters.Add("vals", String.Format("[{0}]", MvcHtmlString.Create(
                                                           String.Join(",", conditionValues.Select(val =>
                                                                                                       {
                                                                                                           var str = val==null?string.Empty: val.ToString();

                                                                                                           if (val is bool)
                                                                                                           {
                                                                                                               str = str.ToLower();
                                                                                                           }

                                                                                                           return String.Format("|{0}|", str);
                                                                                                       })
                                                               ))
                                                 )
                );
        }
        public ModelClientValidationCompareValuesRule(string otherPropertyName, string type, ValidationCompareOperator compareOperator, string errorMessage)
        {
            ErrorMessage = errorMessage;
            ValidationType = RuleName;
            Contract.Assume(ValidationParameters != null);

            ValidationParameters.Add("otherprop", otherPropertyName);
            ValidationParameters.Add("type", type);
            ValidationParameters.Add("operator", compareOperator.GetJavascriptOperator());
        }