Class
FileExtensionToGlyphConverter

Converts a file name string to a glyph character based on its file extension. Each file category (image, document, archive, etc.) maps to a configurable glyph property whose default values correspond to the built-in Telerik font icons.

Definition

Namespace:Telerik.Windows.Controls.ConversationalUI

Assembly:Telerik.Windows.Controls.dll

Syntax:

cs-api-definition
public class FileExtensionToGlyphConverter : IValueConverter

Inheritance: objectFileExtensionToGlyphConverter

Implements: IValueConverter

Constructors

FileExtensionToGlyphConverter()

Declaration

cs-api-definition
public FileExtensionToGlyphConverter()

Properties

ArchiveGlyph

Gets or sets the glyph returned for archive files (.zip, .rar, .7z, .tar, .gz, .bz2). The default value is the GlyphZip character ().

Declaration

cs-api-definition
public string ArchiveGlyph { get; set; }

Property Value

string

AudioGlyph

Gets or sets the glyph returned for audio files (.mp3, .wav, .flac, .ogg, .aac, .wma, .m4a). The default value is the GlyphFileAudio character ().

Declaration

cs-api-definition
public string AudioGlyph { get; set; }

Property Value

string

CodeGlyph

Gets or sets the glyph returned for programming and code files (.cs, .js, .ts, .py, .java, .cpp, .c, .h, .rb, .go, .rs, .swift, .kt, .php, .lua, .r, .sh, .bat, .ps1). The default value is the GlyphFileProgramming character ().

Declaration

cs-api-definition
public string CodeGlyph { get; set; }

Property Value

string

CsvGlyph

Gets or sets the glyph returned for CSV files (.csv). The default value is the GlyphCsv character ().

Declaration

cs-api-definition
public string CsvGlyph { get; set; }

Property Value

string

DataGlyph

Gets or sets the glyph returned for data files (.json, .xml, .sql, .yaml, .yml, .toml, .ini, .config). The default value is the GlyphFileData character ().

Declaration

cs-api-definition
public string DataGlyph { get; set; }

Property Value

string

DefaultGlyph

Gets or sets the default glyph returned when the file extension does not match any known category. The default value is the GlyphFile character ().

Declaration

cs-api-definition
public string DefaultGlyph { get; set; }

Property Value

string

ImageGlyph

Gets or sets the glyph returned for image file extensions (.png, .jpg, .jpeg, .gif, .bmp, .svg, .webp, .ico, .tiff, .tif). The default value is the GlyphFileImage character ().

Declaration

cs-api-definition
public string ImageGlyph { get; set; }

Property Value

string

PdfGlyph

Gets or sets the glyph returned for PDF files (.pdf). The default value is the GlyphPdf character ().

Declaration

cs-api-definition
public string PdfGlyph { get; set; }

Property Value

string

PresentationGlyph

Gets or sets the glyph returned for presentation files (.ppt, .pptx, .odp). The default value is the GlyphFilePresentation character ().

Declaration

cs-api-definition
public string PresentationGlyph { get; set; }

Property Value

string

SpreadsheetGlyph

Gets or sets the glyph returned for spreadsheet files (.xls, .xlsx, .ods). The default value is the GlyphExcel character ().

Declaration

cs-api-definition
public string SpreadsheetGlyph { get; set; }

Property Value

string

TextGlyph

Gets or sets the glyph returned for plain text files (.txt, .log, .md). The default value is the GlyphTxt character ().

Declaration

cs-api-definition
public string TextGlyph { get; set; }

Property Value

string

VideoGlyph

Gets or sets the glyph returned for video files (.mp4, .avi, .mov, .mkv, .wmv, .flv, .webm). The default value is the GlyphFileVideo character ().

Declaration

cs-api-definition
public string VideoGlyph { get; set; }

Property Value

string

WordGlyph

Gets or sets the glyph returned for word-processor document files (.doc, .docx, .rtf, .odt). The default value is the GlyphWord character ().

Declaration

cs-api-definition
public string WordGlyph { get; set; }

Property Value

string

Methods

Convert(object, Type, object, CultureInfo)

Converts a file name to a glyph character based on its file extension.

Declaration

cs-api-definition
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)

Parameters

value

object

The file name string.

targetType

Type

The type of the binding target property.

parameter

object

The converter parameter (not used).

culture

CultureInfo

The culture to use in the converter.

Returns

object

A single-character glyph string matching the file extension category, or DefaultGlyph if no match is found.

ConvertBack(object, Type, object, CultureInfo)

Not supported. Throws NotSupportedException.

Declaration

cs-api-definition
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)

Parameters

value

object

The value that is produced by the binding target.

targetType

Type

The type to convert to.

parameter

object

The converter parameter to use.

culture

CultureInfo

The culture to use in the converter.

Returns

object

Nothing. This method always throws.