/// <summary> /// Validate the object. /// </summary> /// <exception cref="ValidationException"> /// Thrown if validation fails /// </exception> public virtual void Validate() { if (ValidationSettings == null) { throw new ValidationException(ValidationRules.CannotBeNull, "ValidationSettings"); } if (FramingSettings == null) { throw new ValidationException(ValidationRules.CannotBeNull, "FramingSettings"); } if (EnvelopeSettings == null) { throw new ValidationException(ValidationRules.CannotBeNull, "EnvelopeSettings"); } if (AcknowledgementSettings == null) { throw new ValidationException(ValidationRules.CannotBeNull, "AcknowledgementSettings"); } if (MessageFilter == null) { throw new ValidationException(ValidationRules.CannotBeNull, "MessageFilter"); } if (SecuritySettings == null) { throw new ValidationException(ValidationRules.CannotBeNull, "SecuritySettings"); } if (ProcessingSettings == null) { throw new ValidationException(ValidationRules.CannotBeNull, "ProcessingSettings"); } if (SchemaReferences == null) { throw new ValidationException(ValidationRules.CannotBeNull, "SchemaReferences"); } if (ValidationSettings != null) { ValidationSettings.Validate(); } if (FramingSettings != null) { FramingSettings.Validate(); } if (EnvelopeSettings != null) { EnvelopeSettings.Validate(); } if (AcknowledgementSettings != null) { AcknowledgementSettings.Validate(); } if (MessageFilter != null) { MessageFilter.Validate(); } if (SecuritySettings != null) { SecuritySettings.Validate(); } if (ProcessingSettings != null) { ProcessingSettings.Validate(); } if (EnvelopeOverrides != null) { foreach (var element in EnvelopeOverrides) { if (element != null) { element.Validate(); } } } if (ValidationOverrides != null) { foreach (var element1 in ValidationOverrides) { if (element1 != null) { element1.Validate(); } } } if (MessageFilterList != null) { foreach (var element2 in MessageFilterList) { if (element2 != null) { element2.Validate(); } } } if (SchemaReferences != null) { foreach (var element3 in SchemaReferences) { if (element3 != null) { element3.Validate(); } } } if (X12DelimiterOverrides != null) { foreach (var element4 in X12DelimiterOverrides) { if (element4 != null) { element4.Validate(); } } } }