Table of Contents

Class ImageColumn

Namespace
AbanoubNassem.Trinity.Columns
Assembly
AbanoubNassem.Trinity.dll

Represents a column in a Trinity table that stores image data.

public class ImageColumn : TrinityColumn<ImageColumn, string>, ITrinityColumn, ITrinityComponent
Inheritance
ImageColumn
Implements
Inherited Members

Remarks

ImageColumn inherits from TrinityColumn and stores image data as a string.

Constructors

ImageColumn(string)

public ImageColumn(string columnName)

Parameters

columnName string

Properties

Alt

Gets or sets the alternate text for the image.

public string? Alt { get; protected set; }

Property Value

string

AltCallback

Gets or sets the callback function that returns the alternate text for the image.

protected TrinityColumn<ImageColumn, string>.CallbackWithRecord<string>? AltCallback { get; set; }

Property Value

TrinityColumn<ImageColumn, string>.CallbackWithRecord<string>

ComponentName

The component name in the front-end side.

public override string ComponentName { get; }

Property Value

string

Height

Gets or sets the height of the image.

public string? Height { get; protected set; }

Property Value

string

IsCircular

Gets or sets a value indicating whether the image should be displayed as circular.

public bool IsCircular { get; protected set; }

Property Value

bool

IsDownloadable

Gets or sets a value indicating whether the image should be downloadable.

public bool IsDownloadable { get; protected set; }

Property Value

bool

IsPreviewable

Gets or sets a value indicating whether the image should be previewable.

public bool IsPreviewable { get; protected set; }

Property Value

bool

Width

Gets or sets the width of the image.

public string? Width { get; protected set; }

Property Value

string

Methods

Format()

Formats the value of the column, if FormatUsingCallback defined will apply the callback function.

public override void Format()

SetAlt(CallbackWithRecord<string>)

Sets the callback function that returns the alternate text for the image.

public ImageColumn SetAlt(TrinityColumn<ImageColumn, string>.CallbackWithRecord<string> altCallback)

Parameters

altCallback TrinityColumn<ImageColumn, string>.CallbackWithRecord<string>

The callback function to set.

Returns

ImageColumn

The updated ImageColumn instance.

SetAlt(string)

Sets the alternate text for the image.

public ImageColumn SetAlt(string alt)

Parameters

alt string

The alternate text to set.

Returns

ImageColumn

The updated ImageColumn instance.

SetAsCircular(string)

Sets the image to be displayed as circular with the specified size.

public ImageColumn SetAsCircular(string size = "6rem")

Parameters

size string

The size of the circular image. Default is 6rem.

Returns

ImageColumn

The updated ImageColumn instance.

SetAsDownloadable(bool)

Sets the image to be downloadable or not.

public ImageColumn SetAsDownloadable(bool downloadable = true)

Parameters

downloadable bool

A boolean value indicating whether the image should be downloadable.

Returns

ImageColumn

The updated ImageColumn instance.

SetAsPreviewable(bool)

Sets the image to be previewable or not.

public ImageColumn SetAsPreviewable(bool previewable = true)

Parameters

previewable bool

A boolean value indicating whether the image should be previewable.

Returns

ImageColumn

The updated ImageColumn instance.

SetAsSquare(string)

Sets the width and height of the image to the same value to create a square image.

public ImageColumn SetAsSquare(string size = "6rem")

Parameters

size string

The size to set.

Returns

ImageColumn

The updated ImageColumn instance.

SetHeight(string)

Sets the height of the image.

public ImageColumn SetHeight(string height)

Parameters

height string

The height to set.

Returns

ImageColumn

The updated ImageColumn instance.

SetWidth(string)

Sets the width of the image.

public ImageColumn SetWidth(string width)

Parameters

width string

The width to set.

Returns

ImageColumn

The updated ImageColumn instance.