Click or drag to resize

CopyFileManager Class

Represents a resource manager which copies a file when a transaction is successfully committed.
Inheritance Hierarchy

Namespace:  Novacta.Transactions.IO
Assembly:  Novacta.Transactions.IO (in Novacta.Transactions.IO.dll) Version: 1.0.0
Syntax
public sealed class CopyFileManager : CreateFileManager

The CopyFileManager type exposes the following members.

Constructors
  NameDescription
Public methodCopyFileManager
Initializes a new instance of the CopyFileManager class.
Top
Properties
  NameDescription
Public propertyCanOverwrite
Gets a value indicating whether this CreateFileManager is authorized to overwrite the managed file.
(Inherited from CreateFileManager.)
Public propertyFileAlreadyExists
Gets a value indicating whether the managed file already exists at the time of transaction preparation.
(Inherited from CreateFileManager.)
Public propertyManagedFileStream
Provides the stream for the managed file.
(Inherited from FileManager.)
Top
Methods
  NameDescription
Public methodCommit
Notifies an enlisted object that a transaction is being committed.
(Inherited from FileManager.)
Public methodDispose
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
(Inherited from FileManager.)
Public methodEnlistVolatile
Enlists this instance as a volatile resource manager using the specified enlistment options.
(Inherited from FileManager.)
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodInDoubt
Notifies an enlisted object that the status of a transaction is in doubt.
(Inherited from FileManager.)
Public methodPrepare
Notifies an enlisted object that a transaction is being prepared for commitment.
(Inherited from FileManager.)
Public methodRollback
Notifies an enlisted object that a transaction is being rolled back (aborted).
(Inherited from FileManager.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Remarks

A CopyFileManager instance can be created with or without the ability of overwriting the managed destination file. This ability is signaled be the value returned by its property CanOverwrite. When an instance is notified that a transaction is being prepared for commitment, it checks if a file having the specified path already exists. In such case, if CanOverwrite returns false, the operation cannot be executed and the transaction is forced to roll back. This also happens if the manager cannot read the content of the source file.

See Also