Class AdaptiveImage
Represents an adaptive image with three form factors.
Implements
IContentData
IInitializableContent
IModifiedTrackable
IReadOnly<BlockData>
IReadOnly
Inherited Members
BlockData.CreateWritableClone()
ContentData.ResetModified()
ContentData.SetDefaultValues(ContentType)
ContentData.MakeReadOnly()
ContentData.CreateWriteableCloneImplementation()
ContentData.ThrowIfReadOnly()
ContentData.Property
ContentData.IsModified
ContentData.IsReadOnly
Namespace: AdaptiveImages.Models
Assembly: AdaptiveImages.dll
Syntax
[ContentType(GUID = "88f20953-0cec-4aab-a8f4-c164a49ca2c4", AvailableInEditMode = false, GroupName = "AdaptiveImages", Order = 10000)]
[JsonConverter(typeof(AdaptiveImageConverter))]
[JsonConverter(typeof(AdaptiveImageConverter))]
public class AdaptiveImage : BlockData, IContentData, IInitializableContent, IModifiedTrackable, IReadOnly<BlockData>, IReadOnly, IEquatable<AdaptiveImage>
Remarks
Most commonly used for responsive images.
Constructors
AdaptiveImage()
Creates a new AdaptiveImage instance.
Declaration
public AdaptiveImage()
AdaptiveImage(ContentReference)
Creates an adaptive image based on an existing CMS, i.e. ImageData, image.
Declaration
public AdaptiveImage(ContentReference contentReference)
Parameters
Type | Name | Description |
---|---|---|
ContentReference | contentReference | ContentReference for an ImageData instance. |
Remarks
This constructor is primarily intended for fallback scenarios where new AdaptiveImage properties should fall back to existing CMS image properties.
Properties
Large
Gets or sets the image for the desktop (largest) form factor.
Declaration
[Display(Order = 1)]
public virtual SingleImage Large { get; set; }
Property Value
Type | Description |
---|---|
SingleImage |
Medium
Gets or sets the image for the tablet (medium) form factor.
Declaration
[Display(Order = 2)]
public virtual SingleImage Medium { get; set; }
Property Value
Type | Description |
---|---|
SingleImage |
Small
Gets or sets the image for the mobile (smallest) form factor.
Declaration
[Display(Order = 3)]
public virtual SingleImage Small { get; set; }
Property Value
Type | Description |
---|---|
SingleImage |
Methods
Equals(AdaptiveImage?)
Compares two AdaptiveImage instance by validating all form factors are identical, including crop points.
Declaration
public bool Equals(AdaptiveImage? other)
Parameters
Type | Name | Description |
---|---|---|
AdaptiveImage | other | The other AdaptiveImage instance to compare to. |
Returns
Type | Description |
---|---|
bool |
Implements
EPiServer.Core.IContentData
EPiServer.Core.IInitializableContent
EPiServer.Core.IModifiedTrackable
EPiServer.Data.Entity.IReadOnly<T>
EPiServer.Data.Entity.IReadOnly