C# Class BaconBuilder.Model.FileHandlerShii

Mostra file Open project: Revelations/BaconApp

Public Methods

Method Description
FileHandlerShii ( string ext ) : System
GetFileFromMemory ( FileInfo fileInfo ) : IEnumerable

Gets the file from memory if it is loaded, otherwise null

HasFileBeenModified ( FileInfo info ) : bool

Checks whether the file source has been modified. It first checks whether the file has been recorded previously, then compares the modification (UTC) time.

IsFileInMemory ( FileInfo info ) : bool

Checks whether the file is in memory.

LoadDirectory ( DirectoryInfo dI ) : List
LoadFile ( FileInfo info ) : void

Loads and returns the content of the file into memory. Will not load files larger than the safe limit.

SaveFile ( FileInfo info ) : void

Saves the contents in memory to disk and updates the last write time (UTC).

SaveFile ( FileInfo info, IEnumerable contents ) : void

Updates the contents in memory, saves it to disk and updates the last write time.

UpdateFileContentInMemory ( FileInfo info, IEnumerable contents ) : void

Puts contents into the collection of file contents. Must be called before calling SaveFile(System.IO.FileInfo) to update the file contents.

Private Methods

Method Description
GetKey ( FileSystemInfo fileInfo ) : string

Gets a usable key to use for retrieving contents from memory.

Method Details

FileHandlerShii() public method

public FileHandlerShii ( string ext ) : System
ext string
return System

GetFileFromMemory() public method

Gets the file from memory if it is loaded, otherwise null
public GetFileFromMemory ( FileInfo fileInfo ) : IEnumerable
fileInfo System.IO.FileInfo
return IEnumerable

HasFileBeenModified() public method

Checks whether the file source has been modified. It first checks whether the file has been recorded previously, then compares the modification (UTC) time.
public HasFileBeenModified ( FileInfo info ) : bool
info System.IO.FileInfo The file info that allows for a uniform file pathing convention.
return bool

IsFileInMemory() public method

Checks whether the file is in memory.
public IsFileInMemory ( FileInfo info ) : bool
info System.IO.FileInfo
return bool

LoadDirectory() public method

public LoadDirectory ( DirectoryInfo dI ) : List
dI System.IO.DirectoryInfo
return List

LoadFile() public method

Loads and returns the content of the file into memory. Will not load files larger than the safe limit.
public LoadFile ( FileInfo info ) : void
info System.IO.FileInfo The file info that allows for a uniform file pathing convention.
return void

SaveFile() public method

Saves the contents in memory to disk and updates the last write time (UTC).
public SaveFile ( FileInfo info ) : void
info System.IO.FileInfo The file info that allows for a uniform file pathing convention.
return void

SaveFile() public method

Updates the contents in memory, saves it to disk and updates the last write time.
public SaveFile ( FileInfo info, IEnumerable contents ) : void
info System.IO.FileInfo
contents IEnumerable
return void

UpdateFileContentInMemory() public method

Puts contents into the collection of file contents. Must be called before calling SaveFile(System.IO.FileInfo) to update the file contents.
public UpdateFileContentInMemory ( FileInfo info, IEnumerable contents ) : void
info System.IO.FileInfo
contents IEnumerable
return void