Class FileViewModel
- Namespace
- Dynamicweb.Frontend
- Assembly
- Dynamicweb.dll
FileViewModel represents the rendering context used when a file is rendered.
public class FileViewModel : ViewModelBase
- Inheritance
-
FileViewModel
- Derived
- Inherited Members
Constructors
FileViewModel()
Initializes a new instance of the FileViewModel class.
public FileViewModel()
Properties
Extension
Gets the extension.
public string? Extension { get; set; }
Property Value
- string
The extension e.g. '.jpg'
IsImage
Checks if the type is of ImageFileViewModel and returns the boolean corresponding to the result of this check.
public bool IsImage { get; }
Property Value
- bool
Returns true if the this is an ImageFileViewModel and false if it is not.
Name
Gets the name.
public string? Name { get; set; }
Property Value
- string
The name of the file e.g. 'File1'
Path
Gets the relative path.
public string? Path { get; set; }
Property Value
- string
The path of the file e.g. '/Files/Images/myImages.jpg'.
PathUrlEncoded
Gets the path to the file in url encoded format for use in Urls.
public string? PathUrlEncoded { get; }
Property Value
- string
The URL encoded path e.g. 'my%20folder/my%20image.jpg' instead of 'my folder/my image.jpg'.
Methods
ToString()
Returns the path.
public override string? ToString()