Class ValidationRuleConfigurationsXmlSerializer
XML serializer for collection of ValidationRuleConfigurations.
public class ValidationRuleConfigurationsXmlSerializer : ConfigurationsXmlSerializer<ValidationRuleConfiguration>, IValidationRuleConfigurationsXmlSerializer
- Inheritance
-
objectValidationRuleConfigurationsXmlSerializer
- Implements
- Inherited Members
- Extension Methods
Constructors
ValidationRuleConfigurationsXmlSerializer(IValidationRuleDefinitionProvider)
Initializes a new instance of the ValidationRuleConfigurationsXmlSerializer class.
public ValidationRuleConfigurationsXmlSerializer(IValidationRuleDefinitionProvider ruleDefinitionProvider)
Parameters
ruleDefinitionProvider
IValidationRuleDefinitionProviderProvider of validation rule definitions.
Properties
ConfigurationElementName
Gets the name of the element containing the serialized ValidationRuleConfiguration.
protected override string ConfigurationElementName { get; }
Property Value
- string
ConfiguredObjectElementName
Gets the name of the element containing the serialized ValidationRule wrapped by ValidationRuleConfiguration.
protected override string ConfiguredObjectElementName { get; }
Property Value
- string
ConfiguredObjectIdentifierElementName
Gets the name of the element containing type identifier of the serialized ValidationRule wrapped by ValidationRuleConfiguration.
protected override string ConfiguredObjectIdentifierElementName { get; }
Property Value
- string
Methods
CreateDeserializedConfiguration(string, object)
Creates a new ValidationRuleConfiguration based on deserialzed typeIdentifier
and configuredObject
.
protected override ValidationRuleConfiguration CreateDeserializedConfiguration(string typeIdentifier, object configuredObject)
Parameters
typeIdentifier
stringType identifier of the
configuredObject
.configuredObject
objectDeserialized configured object.
Returns
- ValidationRuleConfiguration
Returns deserialized configuration.
Deserialize(string)
Deserializes a collection of validation rule configurations from an XML string.
public virtual List<ValidationRuleConfiguration> Deserialize(string validationRuleConfigurationsXml)
Parameters
validationRuleConfigurationsXml
stringXML representation of the rules to be deserialized.
Returns
- List<ValidationRuleConfiguration>
Returns a collection of validation rule configurations.
GetConfiguredObjectType(string)
Gets validation rule type from a typeIdentifier
.
protected override Type GetConfiguredObjectType(string typeIdentifier)
Parameters
typeIdentifier
string
Returns
- Type
Serialize(IEnumerable<ValidationRuleConfiguration>)
Serializes a collection of validation rule configurations to an XML string.
public virtual string Serialize(IEnumerable<ValidationRuleConfiguration> validationRuleConfigurations)
Parameters
validationRuleConfigurations
IEnumerable<ValidationRuleConfiguration>Validation rule configurations to be serialized.
Returns
- string
Returns an XML representation of the rules.
Exceptions
- ArgumentNullException
Thrown when
validationRuleConfigurations
is null.