private string GetClientAddress()
        {
            var settings = _siteService.GetSiteSettings().As <AuditTrailSettingsPart>();

            if (!settings.EnableClientIpAddressLogging)
            {
                return(null);
            }

            return(_clientHostAddressAccessor.GetClientAddress());
        }
        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();
        }