Table of Contents

Class CMSOutputMediaFile

Namespace
CMS.MediaLibrary
Assembly
CMS.MediaLibrary.dll

Class encapsulating MediaFile.

public class CMSOutputMediaFile : AbstractOutputFile, IDataContainer, ISimpleDataContainer
Inheritance
object
CMSOutputMediaFile
Implements
Inherited Members
Extension Methods

Constructors

CMSOutputMediaFile()

Constructor.

public CMSOutputMediaFile()

CMSOutputMediaFile(MediaFileInfo, byte[])

Constructor.

public CMSOutputMediaFile(MediaFileInfo mi, byte[] data)

Parameters

mi MediaFileInfo

MediaFile info

data byte[]

Output file data

Properties

ColumnNames

Column names.

public List<string> ColumnNames { get; }

Property Value

List<string>

FileExtension

File extension.

public string FileExtension { get; set; }

Property Value

string

FileName

File extension.

public string FileName { get; set; }

Property Value

string

FilePath

File path.

public string FilePath { get; set; }

Property Value

string

this[string]

Gets or sets the value of the column.

public object this[string columnName] { get; set; }

Parameters

columnName string

Column name

Property Value

object

LastModified

Time when the file was last modified.

public DateTime LastModified { get; }

Property Value

DateTime

MediaFile

Media file info object.

public MediaFileInfo MediaFile { get; set; }

Property Value

MediaFileInfo

MimeType

Mime type.

public string MimeType { get; set; }

Property Value

string

OriginalFile

Gets physical file path to the original file.

public string OriginalFile { get; }

Property Value

string

PhysicalFile

Physical file path to the data.

public string PhysicalFile { get; set; }

Property Value

string

PreviewFilePath

Preview file path

public string PreviewFilePath { get; set; }

Property Value

string

UsePreview

Indicates if file preview should be pused for output file.

public bool UsePreview { get; set; }

Property Value

bool

Methods

ContainsColumn(string)

Returns true if the object contains specified column.

public bool ContainsColumn(string columnName)

Parameters

columnName string

Column name

Returns

bool

EnsureData(byte[])

Ensures that the object contains the output data.

public bool EnsureData(byte[] defaultData)

Parameters

defaultData byte[]

Default data which should be loaded if data required

Returns

bool

Returns true if new data has been loaded

GetValue(string)

Returns value of column.

public object GetValue(string columnName)

Parameters

columnName string

Column name

Returns

object

LoadData()

Loads the data to the object.

public void LoadData()

LoadPreview()

Loads the preview data to the object.

public void LoadPreview()

SetValue(string, object)

Sets value of column.

public bool SetValue(string columnName, object value)

Parameters

columnName string

Column name

value object

Column value

Returns

bool

TryGetValue(string, out object)

Returns value of column.

public bool TryGetValue(string columnName, out object value)

Parameters

columnName string

Column name

value object

Returns the value

Returns

bool

Returns true if the operation was successful (the value was present)