C# Class Simulated.FileSystem

Represents a view on the file system. The underlying store could be a real file system or a simulated (in-memory) one. In either case, FileSystem and its helpers allow a user to interact with an abstraction of this storage. FileSystem also supports change tracking. If you call EnableRevertToHere, then you will begin tracking changes from that point. At any point you can dispose the FileSystem view or call RevertChanges to revert to the last save point. You can also call CommitChanges to commit all pending changes. Changes are written to the disk as they occcur. In case of an application crash changes will be saved, not rolled back. Each FileSystem instance is its own view of the storage with its own save point. Call Clone to create another view with the same underlying storage but an independent save point.
Inheritance: IDisposable
显示文件 Open project: arlobelshee/SimulatableApi

Private Properties

Property Type Description
Clone FileSystem
CommitChanges System.Threading.Tasks.Task
Directory FsDirectory
File FsFile
FileSystem System
Real FileSystem
RevertChanges System.Threading.Tasks.Task
Simulated FileSystem

Public Methods

Method Description
Dispose ( ) : void

Rolls back any un-committed changes. If the FileSystem has a save point, then this Dispose will RevertChanges. If there is no save point or if all changes have been committed with CommitChanges, then disposing will have no effect.

EnableRevertToHere ( ) : void

Sets a save point. RevertChanges will revert to this save point. Does not override any existing save point. If a save point is already set then this call has no effect.

Private Methods

Method Description
Clone ( ) : FileSystem
CommitChanges ( ) : System.Threading.Tasks.Task
Directory ( [ absolutePath ) : FsDirectory
File ( [ absoluteFilePath ) : FsFile
FileSystem ( [ disk ) : System
Real ( ) : FileSystem
RevertChanges ( ) : System.Threading.Tasks.Task
Simulated ( ) : FileSystem

Method Details

Dispose() public method

Rolls back any un-committed changes. If the FileSystem has a save point, then this Dispose will RevertChanges. If there is no save point or if all changes have been committed with CommitChanges, then disposing will have no effect.
public Dispose ( ) : void
return void

EnableRevertToHere() public method

Sets a save point. RevertChanges will revert to this save point. Does not override any existing save point. If a save point is already set then this call has no effect.
public EnableRevertToHere ( ) : void
return void