void IFormElementEventHandler.RegisterClientValidation(FormElement element, RegisterClientValidationAttributesContext context) {
            var validators = _formService.GetValidators(element).ToArray();

            foreach (var validator in validators) {
                validator.RegisterClientValidation(element, context);
            }
        }
        public override void GetElementValue(FormElement element, ReadElementValuesContext context) {
            var ipAddressField = element as IpAddressField;

            if (ipAddressField == null)
                return;

            var key = ipAddressField.Name;
            context.Output[key] = _clientHostAddressAccessor.GetClientAddress();
        }
        public override void GetElementValue(FormElement element, ReadElementValuesContext context)
        {
            var fileField = element as FileField;

            if (fileField == null)
                return;

            context.Output[fileField.Name] = fileField.PostedValue;
        }
        public override void GetElementValue(FormElement element, ReadElementValuesContext context) {
            var userNameField = element as UserNameField;

            if (userNameField == null)
                return;

            var key = userNameField.Name;
            var currentUser = _wca.GetContext().CurrentUser;
            context.Output[key] = currentUser != null ? currentUser.UserName : null;
        }
        public override void GetElementValue(FormElement element, ReadElementValuesContext context) {

            if (String.IsNullOrWhiteSpace(element.Name))
                return;

            var key = element.Name;
            var valueProviderResult = context.ValueProvider.GetValue(key);

            if (String.IsNullOrWhiteSpace(key) || valueProviderResult == null)
                return;

            var items = valueProviderResult.RawValue as string[];
            if (items == null)
                return;

            var combinedValues = String.Join(",", items);
            context.Output[key] = combinedValues;
            element.RuntimeValue = combinedValues;
            element.PostedValue = combinedValues;
        }
 void IFormElementEventHandler.GetElementValue(FormElement element, ReadElementValuesContext context) { }
 public virtual void RegisterClientValidation(FormElement element, RegisterClientValidationAttributesContext context) {}
 public virtual void GetElementValue(FormElement element, ReadElementValuesContext context) {}