ChinhDo.Transactions.TxFileManager.TxEnlistment.Copy C# (CSharp) Method

Copy() public method

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.
return void
			public void Copy(string sourceFileName, string destFileName, bool overwrite)
			{
				var r = new RollbackFile(destFileName);
				try
				{
					File.Copy(sourceFileName, destFileName, overwrite);
				}
				catch (Exception e)
				{
					r.CleanUp();
					throw new Exception(e.Message, e);
				}
				if (_tx != null)
				{
					_journal.Add(r);
					Enlist();
				}
			}