C# 클래스 ChinhDo.Transactions.TxFileManager.TxEnlistment

Provides two-phase commits/rollbacks/etc for a single Transaction.
상속: IEnlistmentNotification, IFileOperations
파일 보기 프로젝트 열기: NexusMods/NexusModManager-4.5

공개 메소드들

메소드 설명
AppendAllText ( string path, string contents ) : void

Appends the specified string the file, creating the file if it doesn't already exist.

Commit ( Enlistment enlistment ) : void
Copy ( string sourceFileName, string destFileName, bool overwrite ) : void

Copies the specified sourceFileName to destFileName.

CreateDirectory ( string path ) : void

Creates all directories in the specified path.

Delete ( string path ) : void

Deletes the specified file or directory. An exception is not thrown if the file does not exist.

InDoubt ( Enlistment enlistment ) : void
Move ( string srcFileName, string destFileName ) : void

Moves the specified file to a new location.

Prepare ( PreparingEnlistment preparingEnlistment ) : void
Rollback ( Enlistment enlistment ) : void

Notifies an enlisted object that a transaction is being rolled back (aborted).

This is typically called on a different thread from the transaction thread.

Snapshot ( string fileName ) : void

Take a snapshot of the specified file. The snapshot is used to rollback the file later if needed.

TxEnlistment ( ) : System

Initializes a new instance of the TxEnlistment class.

TxEnlistment ( Transaction tx ) : System

Initializes a new instance of the TxEnlistment class.

WriteAllBytes ( string path, byte contents ) : void

Creates a file, and writes the specified contents to the file. If the file already exists, it is overwritten.

WriteAllText ( string path, string contents ) : void

Creates a file, write the specified contents to the file.

비공개 메소드들

메소드 설명
Enlist ( ) : void

메소드 상세

AppendAllText() 공개 메소드

Appends the specified string the file, creating the file if it doesn't already exist.
public AppendAllText ( string path, string contents ) : void
path string The file to append the string to.
contents string The string to append to the file.
리턴 void

Commit() 공개 메소드

public Commit ( Enlistment enlistment ) : void
enlistment Nexus.Transactions.Enlistment
리턴 void

Copy() 공개 메소드

Copies the specified sourceFileName to destFileName.
public Copy ( string sourceFileName, string destFileName, bool overwrite ) : void
sourceFileName string The file to copy.
destFileName string The name of the destination file.
overwrite bool true if the destination file can be overwritten, otherwise false.
리턴 void

CreateDirectory() 공개 메소드

Creates all directories in the specified path.
public CreateDirectory ( string path ) : void
path string The directory path to create.
리턴 void

Delete() 공개 메소드

Deletes the specified file or directory. An exception is not thrown if the file does not exist.
public Delete ( string path ) : void
path string The file to be deleted.
리턴 void

InDoubt() 공개 메소드

public InDoubt ( Enlistment enlistment ) : void
enlistment Nexus.Transactions.Enlistment
리턴 void

Move() 공개 메소드

Moves the specified file to a new location.
public Move ( string srcFileName, string destFileName ) : void
srcFileName string The name of the file to move.
destFileName string The new path for the file.
리턴 void

Prepare() 공개 메소드

public Prepare ( PreparingEnlistment preparingEnlistment ) : void
preparingEnlistment Nexus.Transactions.PreparingEnlistment
리턴 void

Rollback() 공개 메소드

Notifies an enlisted object that a transaction is being rolled back (aborted).
This is typically called on a different thread from the transaction thread.
public Rollback ( Enlistment enlistment ) : void
enlistment Nexus.Transactions.Enlistment A object used to send a response to the transaction manager.
리턴 void

Snapshot() 공개 메소드

Take a snapshot of the specified file. The snapshot is used to rollback the file later if needed.
public Snapshot ( string fileName ) : void
fileName string The file to take a snapshot for.
리턴 void

TxEnlistment() 공개 메소드

Initializes a new instance of the TxEnlistment class.
public TxEnlistment ( ) : System
리턴 System

TxEnlistment() 공개 메소드

Initializes a new instance of the TxEnlistment class.
public TxEnlistment ( Transaction tx ) : System
tx Nexus.Transactions.Transaction The Transaction.
리턴 System

WriteAllBytes() 공개 메소드

Creates a file, and writes the specified contents to the file. If the file already exists, it is overwritten.
public WriteAllBytes ( string path, byte contents ) : void
path string The file to write to.
contents byte The bytes to write to the file.
리턴 void

WriteAllText() 공개 메소드

Creates a file, write the specified contents to the file.
public WriteAllText ( string path, string contents ) : void
path string The file to write to.
contents string The string to write to the file.
리턴 void