Exemple #1
0
 /// <summary>
 /// Gets the ordered stask of mods that have installed the given item.
 /// </summary>
 /// <param name="p_tItem">The item for which to retrieve the installing mods.</param>
 /// <returns>The ordered stask of mods that have installed the given item.</returns>
 public InstallerStack <K> this[T p_tItem]
 {
     get
     {
         if (!m_dicInstalledItems.ContainsKey(p_tItem))
         {
             m_dicInstalledItems[p_tItem] = new InstalledItemDictionary <T, K> .ItemInstallers(p_tItem);
         }
         return(m_dicInstalledItems[p_tItem].Installers);
     }
 }
        private bool CheckFileKeyValuePair(InstalledItemDictionary <string, object> .ItemInstallers p_item)
        {
            Trace.WriteLine("File kvp:");

            try
            {
                Trace.WriteLine(p_item.Item);
                Trace.WriteLine(GetCurrentFileOwnerLogged(p_item.Item).Filename);
            }
            catch {}

            return(true);
        }
 /// <summary>
 /// A simple constructor that initializes the object with its dependencies.
 /// </summary>
 /// <param name="p_mdrManagedModRegistry">The <see cref="ModRegistry"/> that contains the list
 /// of managed <see cref="IMod"/>s.</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>
 private InstallLog(ModRegistry p_mdrManagedModRegistry, string p_strModInstallDirectory, string p_strLogPath)
 {
     m_dicInstalledFiles    = new InstalledItemDictionary <string, object>(StringComparer.OrdinalIgnoreCase);
     m_dicInstalledIniEdits = new InstalledItemDictionary <IniEdit, string>();
     m_dicInstalledGameSpecificValueEdits = new InstalledItemDictionary <string, byte[]>();
     ModInstallDirectory = p_strModInstallDirectory.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar).Trim(Path.DirectorySeparatorChar) + Path.DirectorySeparatorChar;
     ManagedModRegistry  = p_mdrManagedModRegistry;
     LogPath             = p_strLogPath;
     LoadInstallLog();
     if (!m_amrModKeys.IsModRegistered(OriginalValueMod))
     {
         AddActiveMod(OriginalValueMod, true);
     }
 }
			/// <summary>
			/// A simple constructor that initializes the object with the given values.
			/// </summary>
			/// <param name="p_txTransaction">The transaction into which we are enlisting.</param>
			/// <param name="p_ilgInstallLog">The install log whose actions are being transacted.</param>
			public TransactionEnlistment(Transaction p_txTransaction, InstallLog p_ilgInstallLog)
			{
				CurrentTransaction = p_txTransaction;
				EnlistedInstallLog = p_ilgInstallLog;
				m_dicInstalledFiles = new InstalledItemDictionary<string, object>(StringComparer.OrdinalIgnoreCase);
				m_dicUninstalledFiles = new InstalledItemDictionary<string, object>(StringComparer.OrdinalIgnoreCase);

				m_dicInstalledIniEdits = new InstalledItemDictionary<IniEdit, string>();
				m_dicReplacedIniEdits = new InstalledItemDictionary<IniEdit, string>();
				m_dicUninstalledIniEdits = new InstalledItemDictionary<IniEdit, string>();

				m_dicInstalledGameSpecificValueEdits = new InstalledItemDictionary<string, byte[]>();
				m_dicReplacedGameSpecificValueEdits = new InstalledItemDictionary<string, byte[]>();
				m_dicUninstalledGameSpecificValueEdits = new InstalledItemDictionary<string, byte[]>();
			}
        /// <summary>
        /// A simple constructor that initializes the object with its dependencies.
        /// </summary>
        /// <param name="managedModRegistry">The <see cref="ModRegistry"/> that contains the list
        /// of managed <see cref="IMod"/>s.</param>
        /// <param name="gameMode">The current game mode.</param>
        /// <param name="modInstallDirectory">The path of the directory where all of the mods are installed.</param>
        /// <param name="logPath">The path from which to load the install log information.</param>
        private InstallLog(ModRegistry managedModRegistry, IGameMode gameMode, string modInstallDirectory, string logPath)
        {
            _installedFiles         = new InstalledItemDictionary <string, object>(StringComparer.OrdinalIgnoreCase);
            _installedIniEdits      = new InstalledItemDictionary <IniEdit, string>();
            _gameSpecificValueEdits = new InstalledItemDictionary <string, byte[]>();

            ModInstallDirectory = modInstallDirectory.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar).TrimEnd(Path.DirectorySeparatorChar) + Path.DirectorySeparatorChar;
            ManagedModRegistry  = managedModRegistry;
            LogPath             = logPath;
            GameMode            = gameMode;

            LoadInstallLog();

            if (!_activeModRegistry.IsModRegistered(OriginalValueMod))
            {
                AddActiveMod(OriginalValueMod, true);
            }
        }
		/// <summary>
		/// A simple constructor that initializes the object with its dependencies.
		/// </summary>
		/// <param name="p_mdrManagedModRegistry">The <see cref="ModRegistry"/> that contains the list
		/// of managed <see cref="IMod"/>s.</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>
		private InstallLog(ModRegistry p_mdrManagedModRegistry, string p_strModInstallDirectory, string p_strLogPath)
		{
			m_dicInstalledFiles = new InstalledItemDictionary<string, object>(StringComparer.OrdinalIgnoreCase);
			m_dicInstalledIniEdits = new InstalledItemDictionary<IniEdit, string>();
			m_dicInstalledGameSpecificValueEdits = new InstalledItemDictionary<string, byte[]>();
			ModInstallDirectory = p_strModInstallDirectory.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar).Trim(Path.DirectorySeparatorChar) + Path.DirectorySeparatorChar;
			ManagedModRegistry = p_mdrManagedModRegistry;
			LogPath = p_strLogPath;
			LoadInstallLog();
			if (!m_amrModKeys.IsModRegistered(OriginalValueMod))
				AddActiveMod(OriginalValueMod, true);
		}