Show / Hide Table of Contents

Class ImageValidator

Base class with utility methods for validator implementations.

Inheritance
object
ImageValidator
AdaptiveImageValidator
SingleImageValidator
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: AdaptiveImages.Validation
Assembly: AdaptiveImages.dll
Syntax
public abstract class ImageValidator

Constructors

ImageValidator(IContentLoader?, LocalizationService?, IPublishedStateAssessor?, IAddonSettings?)

Creates a new validator for content with image properties.

Declaration
public ImageValidator(IContentLoader? contentLoader = null, LocalizationService? localizationService = null, IPublishedStateAssessor? publishedStateAssessor = null, IAddonSettings? addonSettings = null)
Parameters
Type Name Description
IContentLoader contentLoader
LocalizationService localizationService
IPublishedStateAssessor publishedStateAssessor
IAddonSettings addonSettings

Methods

GetImageProperties<TImageProperty>(IContentData)

Gets image properties, if any, of the specified type for a content instance.

Declaration
protected virtual IEnumerable<(PropertyInfo property, IContentData parent)> GetImageProperties<TImageProperty>(IContentData parent) where TImageProperty : BlockData
Parameters
Type Name Description
IContentData parent

The instance to recursively check for image properties of the specified type.

Returns
Type Description
IEnumerable<(PropertyInfo property, IContentData parent)>

All image properties of the specified type, paired with the actual parent content (applicable when image property is nested in a local block)

Type Parameters
Name Description
TImageProperty

Validate<TImageProperty>(IContentData)

Validates any image properties of the specified type on the content instance.

Declaration
protected virtual IEnumerable<ValidationError> Validate<TImageProperty>(IContentData instance) where TImageProperty : BlockData
Parameters
Type Name Description
IContentData instance

Content instance, such as a page or block.

Returns
Type Description
IEnumerable<ValidationError>

Validation errors, if any.

Type Parameters
Name Description
TImageProperty

Extension Methods

ImageExtensions.GetCultureSpecificImageAttribute<TContent, TProperty>(TContent, Expression<Func<TContent, TProperty>>)
ImageExtensions.GetImageConstraints<TParent>(TParent, string)
ImageExtensions.GetImageConstraints<TParent, TProperty>(TParent, Expression<Func<TParent, TProperty>>)
ImageExtensions.GetImageRenderSettings<TParent, TProperty>(TParent, Expression<Func<TParent, TProperty>>)
ImageExtensions.GetImageRenderSettings<TParent, TProperty>(TParent, Expression<Func<TParent, TProperty>>, FormFactor)
ImageExtensions.GetProportionsConstraint<TParent>(TParent, string)
ImageExtensions.GetProportionsConstraint<TParent>(TParent, string, FormFactor)
ImageExtensions.GetProportionsConstraint<TParent, TProperty>(TParent, Expression<Func<TParent, TProperty>>)
ImageExtensions.GetRequiredImageAttribute<TContent, TProperty>(TContent, Expression<Func<TContent, TProperty>>)
ImageExtensions.GetSizeConstraint<TContent, TProperty>(TContent, Expression<Func<TContent, TProperty>>)
☀
☾
In this article
Back to top
Documentation applies to: Adaptive Images 2.x
☀
☾