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; }
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 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 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; }
void IFormElementEventHandler.GetElementValue(FormElement element, ReadElementValuesContext context) { }