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

WriteAllBytes() public method

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.
return void
			public void WriteAllBytes(string path, byte[] contents)
			{
				var r = new RollbackFile(path);
				try
				{
					File.WriteAllBytes(path, contents);
				}
				catch (Exception e)
				{
					r.CleanUp();
					throw new Exception(e.Message, e);
				}
				if (_tx != null)
				{
					_journal.Add(r);
					Enlist();
				}
			}