ChinhDo.Transactions.TxFileManager.Snapshot C# (CSharp) Method

Snapshot() public method

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.
return void
        public void Snapshot(string fileName)
        {
            GetEnlistment().Snapshot(fileName);
        }

Usage Example

Example #1
0
		/// <summary>
		/// Called to perform the upgrade.
		/// </summary>
		/// <remarks>
		/// Sets up the resources required to upgrade the install log.
		/// </remarks>
		/// <param name="p_mdrManagedModRegistry">The <see cref="ModRegistry"/> that contains the list
		/// of managed mods.</param>
		/// <param name="p_strModInstallDirectory">The path of the directory where all of the mods are installed.</param>
		/// <param name="p_strLogPath">The path from which to load the install log information.</param>
		public void Upgrade(string p_strLogPath, string p_strModInstallDirectory, ModRegistry p_mdrManagedModRegistry)
		{
			Trace.WriteLine("Beginning Install Log Upgrade.");

			m_tfmFileManager = new TxFileManager();
			using (TransactionScope tsTransaction = new TransactionScope())
			{
				m_tfmFileManager.Snapshot(p_strLogPath);
				Start(p_strLogPath, p_strModInstallDirectory, p_mdrManagedModRegistry);
				tsTransaction.Complete();
				m_tfmFileManager = null;
			}
		}
All Usage Examples Of ChinhDo.Transactions.TxFileManager::Snapshot