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

Move() public method

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