Class FormComponentPropertiesMapper
Contains mapping methods for conversions between form component properties and form field definition.
public class FormComponentPropertiesMapper : IFormComponentPropertiesMapper
- Inheritance
-
objectFormComponentPropertiesMapper
- Implements
- Extension Methods
Constructors
FormComponentPropertiesMapper(IFormComponentDefinitionProvider, IFormComponentActivator, IEditablePropertiesCollector, IValidationRuleConfigurationsXmlSerializer, IVisibilityConditionConfigurationXmlSerializer)
Initializes a new instance of the FormComponentPropertiesMapper class.
public FormComponentPropertiesMapper(IFormComponentDefinitionProvider formComponentDefinitionProvider, IFormComponentActivator formComponentActivator, IEditablePropertiesCollector editablePropertiesCollector, IValidationRuleConfigurationsXmlSerializer validationRuleConfigurationsXmlSerializer, IVisibilityConditionConfigurationXmlSerializer visibilityConditionConfigurationXmlSerializer)
Parameters
formComponentDefinitionProvider
IFormComponentDefinitionProviderProvider for registered form components retrieval.
formComponentActivator
IFormComponentActivatorActivator for form components.
editablePropertiesCollector
IEditablePropertiesCollectorCollects editable properties from a model.
validationRuleConfigurationsXmlSerializer
IValidationRuleConfigurationsXmlSerializerSerializer for validation rules stored in ValidationRuleConfigurationsXmlData.
visibilityConditionConfigurationXmlSerializer
IVisibilityConditionConfigurationXmlSerializerSerializer for visibility condition stored in VisibilityConditionConfigurationXmlData.
Methods
FromFieldInfo(FormFieldInfo)
Maps an instance of FormFieldInfo to corresponding FormComponentProperties. To extract identifier of corresponding FormComponentDefinition use GetComponentIdentifier(FormFieldInfo).
public virtual FormComponentProperties FromFieldInfo(FormFieldInfo formFieldInfo)
Parameters
formFieldInfo
FormFieldInfoForm field to be mapped.
Returns
- FormComponentProperties
Returns an instance of FormComponentProperties which corresponds to given form field.
Exceptions
- ArgumentNullException
Thrown when
formFieldInfo
is null.- InvalidOperationException
Thrown when
formFieldInfo
contains an unknown form component identifier-or-
when corresponding component properties contain a property of type which is not supported by DataTypeManager.
GetComponentIdentifier(FormFieldInfo)
Gets FormComponentDefinition identifier stored in formFieldInfo
.
public virtual string GetComponentIdentifier(FormFieldInfo formFieldInfo)
Parameters
formFieldInfo
FormFieldInfoForm field info for which to obtain FormComponentDefinition's identifier.
Returns
- string
Return identifier obtained from
formFieldInfo
.
Exceptions
- ArgumentNullException
Thrown when
formFieldInfo
is null.- InvalidOperationException
Thrown when
formFieldInfo
does not specify a form component identifier.
ToFormFieldInfo(FormComponentProperties, string)
Maps an instance of FormComponentProperties to corresponding FormFieldInfo.
public virtual FormFieldInfo ToFormFieldInfo(FormComponentProperties formComponentProperties, string componentIdentifier)
Parameters
formComponentProperties
FormComponentPropertiesForm component properties to be mapped.
componentIdentifier
stringIdentifier of corresponding FormComponentDefinition to be stored along with
formComponentProperties
.
Returns
- FormFieldInfo
Returns an instance of FormFieldInfo which corresponds to given properties and type identifier.
Exceptions
- ArgumentNullException
Thrown when
formComponentProperties
is null.- InvalidOperationException
Thrown when
formComponentProperties
contain a property of type which is not supported by DataTypeManager.