Class AdaptiveImage
Represents an adaptive image with three form factors.
Inheritance
object
EPiServer.Core.ContentData
EPiServer.Core.BlockData
AdaptiveImage
Implements
EPiServer.Core.IContentData
EPiServer.Core.IInitializableContent
EPiServer.Core.IModifiedTrackable
EPiServer.Data.Entity.IReadOnly<T><EPiServer.Core.BlockData>
EPiServer.Data.Entity.IReadOnly
System.IEquatable<T><AdaptiveImage>
Inherited Members
EPiServer.Core.BlockData.CreateWritableClone()
EPiServer.Core.ContentData.ResetModified()
EPiServer.Core.ContentData.SetDefaultValues(EPiServer.DataAbstraction.ContentType)
EPiServer.Core.ContentData.MakeReadOnly()
EPiServer.Core.ContentData.CreateWriteableCloneImplementation()
EPiServer.Core.ContentData.ThrowIfReadOnly()
EPiServer.Core.ContentData.GetValue(string)
EPiServer.Core.ContentData.SetValue(string, object)
EPiServer.Core.ContentData.Property
EPiServer.Core.ContentData.IsModified
EPiServer.Core.ContentData.IsReadOnly
EPiServer.Core.ContentData.this[string]
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
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>
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 |
---|---|---|
EPiServer.Core.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
System.IEquatable<T>