FileSurfer 2.1.2
Cross-platform file manager with support for Git and SFTP
Loading...
Searching...
No Matches
FileSurfer.Core.ViewModels.FileSystemEntryViewModel Class Referencesealed

Represents a displayable file system entry (file, or directory) in the FileSurfer application. More...

Inheritance diagram for FileSurfer.Core.ViewModels.FileSystemEntryViewModel:
Collaboration diagram for FileSurfer.Core.ViewModels.FileSystemEntryViewModel:

Public Member Functions

 FileSystemEntryViewModel (IFileSystem fileSystem, FileEntryInfo entry)
 Initializes a new instance of the FileSystemEntryViewModel class for a file or directory.
 FileSystemEntryViewModel (IFileSystem fileSystem, DirectoryEntryInfo entry)
 Initializes a new instance of the FileSystemEntryViewModel class for a directory.

Static Public Member Functions

static string GetSizeString (long sizeInB)
 Converts file size in bytes to a human-readable format.

Package Functions

void UpdateGitStatus (GitStatus newStatus)
 Updates version-control flags shown for this entry based on a new Git status value.

Properties

string PathToEntry [get]
 Path to the file, directory, or drive represented by this FileSystemEntryViewModel.
bool IsDirectory [get]
 Specifies if this FileSystemEntryViewModel is a directory.
Bitmap? Icon [get]
 Holds a Bitmap representing the file.
string Name [get]
 Holds the name of file, directory, or drive represented by this FileSystemEntryViewModel.
DateTime LastModTime [get]
 Holds the DateTime of this entry's last modification date.
string LastModified [get]
 Holds this entry's last modification date as string.
long? SizeB [get]
 Holds this entry's size in bytes.
string Size [get]
 Holds this entry's size as human-readable string.
string Type [get]
 Holds this entry's type in the context of FileSurfer.
double Opacity [get]
 Holds this FileSystemEntryViewModel's opacity in the context of Views.MainWindow.
bool VersionControlled [get]
 Specifies if the file represented by this FileSystemEntryViewModel is part of a repository.
bool Staged [get]
 Specifies if the file represented by this FileSystemEntryViewModel has been staged for the next commit.
bool IsArchived = false [get]
 Specifies if the file is in an archived format supported by FileSurfer.
bool SupportsOpenAs [get]
 Specifies if the open as dialog can be invoked on this entry.
IFileSystemEntry FileSystemEntry [get]
 Holds the underlying IFileSystemEntry.

Detailed Description

Represents a displayable file system entry (file, or directory) in the FileSurfer application.

Manages properties associated with files and directories, such as their name, size, type, last modification time, and icon. Also includes data about special conditions like hidden files, or version control status.

Constructor & Destructor Documentation

◆ FileSystemEntryViewModel() [1/2]

FileSurfer.Core.ViewModels.FileSystemEntryViewModel.FileSystemEntryViewModel ( IFileSystem fileSystem,
FileEntryInfo entry )
inline

Initializes a new instance of the FileSystemEntryViewModel class for a file or directory.

Sets up properties like the name, icon, size, type, and last modified date based on the provided path and version control status.

Parameters
fileSystemThe file-system services used to resolve icon data, archive capabilities, and visibility state.
entryThe file entry model used to initialize metadata such as size, extension, and timestamps.
Here is the call graph for this function:

◆ FileSystemEntryViewModel() [2/2]

FileSurfer.Core.ViewModels.FileSystemEntryViewModel.FileSystemEntryViewModel ( IFileSystem fileSystem,
DirectoryEntryInfo entry )
inline

Initializes a new instance of the FileSystemEntryViewModel class for a directory.

Sets up directory-specific display data and asynchronously resolves the directory icon.

Parameters
fileSystemThe file-system services used to resolve icon data, archive capabilities, and visibility state.
entryThe directory entry model used to initialize metadata such as name and timestamps.
Here is the call graph for this function:

Member Function Documentation

◆ GetSizeString()

string FileSurfer.Core.ViewModels.FileSystemEntryViewModel.GetSizeString ( long sizeInB)
inlinestatic

Converts file size in bytes to a human-readable format.

Parameters
sizeInBSize of the file in bytes
Returns
Human-readable file size as string.
Here is the caller graph for this function:

◆ UpdateGitStatus()

void FileSurfer.Core.ViewModels.FileSystemEntryViewModel.UpdateGitStatus ( GitStatus newStatus)
inlinepackage

Updates version-control flags shown for this entry based on a new Git status value.

Parameters
newStatusThe Git status to apply when determining whether the entry is tracked and staged.

Property Documentation

◆ FileSystemEntry

IFileSystemEntry FileSurfer.Core.ViewModels.FileSystemEntryViewModel.FileSystemEntry
get

Holds the underlying IFileSystemEntry.

◆ Icon

Bitmap? FileSurfer.Core.ViewModels.FileSystemEntryViewModel.Icon
get

Holds a Bitmap representing the file.

◆ IsArchived

bool FileSurfer.Core.ViewModels.FileSystemEntryViewModel.IsArchived = false
get

Specifies if the file is in an archived format supported by FileSurfer.

◆ IsDirectory

bool FileSurfer.Core.ViewModels.FileSystemEntryViewModel.IsDirectory
get

Specifies if this FileSystemEntryViewModel is a directory.

◆ LastModified

string FileSurfer.Core.ViewModels.FileSystemEntryViewModel.LastModified
get

Holds this entry's last modification date as string.

◆ LastModTime

DateTime FileSurfer.Core.ViewModels.FileSystemEntryViewModel.LastModTime
get

Holds the DateTime of this entry's last modification date.

◆ Name

string FileSurfer.Core.ViewModels.FileSystemEntryViewModel.Name
get

Holds the name of file, directory, or drive represented by this FileSystemEntryViewModel.

◆ Opacity

double FileSurfer.Core.ViewModels.FileSystemEntryViewModel.Opacity
get

Holds this FileSystemEntryViewModel's opacity in the context of Views.MainWindow.

◆ PathToEntry

string FileSurfer.Core.ViewModels.FileSystemEntryViewModel.PathToEntry
get

Path to the file, directory, or drive represented by this FileSystemEntryViewModel.

◆ Size

string FileSurfer.Core.ViewModels.FileSystemEntryViewModel.Size
get

Holds this entry's size as human-readable string.

◆ SizeB

long? FileSurfer.Core.ViewModels.FileSystemEntryViewModel.SizeB
get

Holds this entry's size in bytes.

◆ Staged

bool FileSurfer.Core.ViewModels.FileSystemEntryViewModel.Staged
get

Specifies if the file represented by this FileSystemEntryViewModel has been staged for the next commit.

◆ SupportsOpenAs

bool FileSurfer.Core.ViewModels.FileSystemEntryViewModel.SupportsOpenAs
get

Specifies if the open as dialog can be invoked on this entry.

◆ Type

string FileSurfer.Core.ViewModels.FileSystemEntryViewModel.Type
get

Holds this entry's type in the context of FileSurfer.

◆ VersionControlled

bool FileSurfer.Core.ViewModels.FileSystemEntryViewModel.VersionControlled
get

Specifies if the file represented by this FileSystemEntryViewModel is part of a repository.


The documentation for this class was generated from the following file: