Skip to main content

FileIcons

Assembly: ServiceStack.Blazor.dll
View Source
Declaration
public static class FileIcons

Fields

Icons

View Source
Declaration
public static Dictionary<string, string> Icons

Methods

EncodeSvg(String)

Encode SVG for embedding in Data URI

View Source
Declaration
public static string EncodeSvg(string svg)
Returns

System.String

Parameters
TypeName
System.Stringsvg

SvgToDataUri(String)

Convert SVG to Data URI

View Source
Declaration
public static string SvgToDataUri(string svg)
Returns

System.String

Parameters
TypeName
System.Stringsvg

GetFileName(String)

Return file name part of URI or file path

View Source
Declaration
public static string GetFileName(string path)
Returns

System.String

Parameters
TypeName
System.Stringpath

GetExt(String)

Return file extension (without '.; prefix) of path or URI

View Source
Declaration
public static string GetExt(string path)
Returns

System.String

Parameters
TypeName
System.Stringpath

CanPreview(String)

Return whether path is a URI to a previewable image

View Source
Declaration
public static bool CanPreview(string path)
Returns

System.Boolean

Parameters
TypeName
System.Stringpath

FilePathUri(String)

Get the Icon src for a file path or URI, previewable resources will return self, otherwise returns SVG URI of .ext

View Source
Declaration
public static string FilePathUri(string path)
Returns

System.String

Parameters
TypeName
System.Stringpath

ExtSrc(String)

Get Icon src for .ext

View Source
Declaration
public static string ExtSrc(string ext)
Returns

System.String

Parameters
TypeName
System.Stringext

ExtSvg(String)

Get Icon SVG for .ext

View Source
Declaration
public static string ExtSvg(string ext)
Returns

System.String

Parameters
TypeName
System.Stringext

IconFallbackSrc(String, String)

View Source
Declaration
public static string IconFallbackSrc(string src, string fallbackSrc = null)
Returns

System.String

Parameters
TypeName
System.Stringsrc
System.StringfallbackSrc