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
		/// <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;
			}
		}
Beispiel #2
0
    /// <summary>
    ///   Called to perform the upgrade.
    /// </summary>
    /// <remarks>
    ///   Sets up the resources required to upgrade the install log, and then
    ///   call <see cref="DoUpgrade()" /> so implementers can do the upgrade.
    /// </remarks>
    /// <returns>
    ///   <lang langref="true" /> if the upgrade completed; <lang langref="false" />
    ///   if the user cancelled.
    /// </returns>
    internal bool PerformUpgrade()
    {
      FileManager = new TxFileManager();
      var booComplete = false;
      using (var tsTransaction = new TransactionScope())
      {
        FileManager.Snapshot(InstallLog.Current.InstallLogPath);

        using (ProgressWorker = new BackgroundWorkerProgressDialog(DoUpgrade))
        {
          ProgressWorker.OverallMessage = "Upgrading FOMM Files";
          if (ProgressWorker.ShowDialog() == DialogResult.OK)
          {
            booComplete = true;
            tsTransaction.Complete();
          }
        }
        FileManager = null;
      }
      return booComplete;
    }
Beispiel #3
0
        /// <summary>
        /// Called to perform the upgrade.
        /// </summary>
        /// <remarks>
        /// Sets up the resources required to upgrade the install log, and then
        /// call <see cref="DoUpgrade()"/> so implementers can do the upgrade.
        /// </remarks>
        /// <returns><lang cref="true"/> if the upgrade completed; <lang cref="false"/>
        /// if the user cancelled.</returns>
        internal bool PerformUpgrade()
        {
            #if TRACE
            Trace.WriteLine("Beginning Install Log Upgrade.");
            #endif
            m_tfmFileManager = new TxFileManager();
            bool booComplete = false;
            using (TransactionScope tsTransaction = new TransactionScope())
            {
                m_tfmFileManager.Snapshot(InstallLog.Current.InstallLogPath);

                using (m_pgdProgress = new BackgroundWorkerProgressDialog(DoUpgrade))
                {
                    m_pgdProgress.OverallMessage = "Upgrading FOMM Files";
                    if (m_pgdProgress.ShowDialog() == DialogResult.OK)
                    {
                        booComplete = true;
                        tsTransaction.Complete();
                    }
                }
                m_tfmFileManager = null;
            }
            return booComplete;
        }