A transaction.
This transaction class has no timeout. This class allows sharing of transactions across threads, as the abient transaction is not restricted to a single thread.
Inheritance: IDisposable
			/// <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_polPluginOrderLog">The <see cref="PluginOrderLog"/> whose actions are being transacted.</param>
			public TransactionEnlistment(Transaction p_txTransaction, PluginOrderLog p_polPluginOrderLog)
			{
				CurrentTransaction = p_txTransaction;
				EnlistedPluginOrderLog = p_polPluginOrderLog;
				m_oclOrderedPlugins = new ThreadSafeObservableList<Plugin>(EnlistedPluginOrderLog.m_oclOrderedPlugins);
				m_rolOrderedPlugins = new ReadOnlyObservableList<Plugin>(m_oclOrderedPlugins);

				EnlistedPluginOrderLog.m_oclOrderedPlugins.CollectionChanged += new NotifyCollectionChangedEventHandler(MasterOrderedPlugins_CollectionChanged);
			}
			/// <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_aplPluginLog">The <see cref="ActivePluginLog"/> whose actions are being transacted.</param>
			public TransactionEnlistment(Transaction p_txTransaction, ActivePluginLog p_aplPluginLog)
			{
				CurrentTransaction = p_txTransaction;
				EnlistedPluginLog = p_aplPluginLog;
				m_ostActivePlugins = new ObservableSet<Plugin>(EnlistedPluginLog.m_ostActivePlugins, PluginComparer.Filename);
				m_rolActivePlugins = new ReadOnlyObservableList<Plugin>(m_ostActivePlugins);

				EnlistedPluginLog.m_ostActivePlugins.CollectionChanged += new NotifyCollectionChangedEventHandler(MasterPlugins_CollectionChanged);
			}
			/// <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 the given values.
			/// </summary>
			/// <param name="p_txTransaction">The transaction into which we are enlisting.</param>
			/// <param name="p_prgPluginRegistry">The <see cref="PluginRegistry"/> whose actions are being transacted.</param>
			public TransactionEnlistment(Transaction p_txTransaction, PluginRegistry p_prgPluginRegistry)
			{
				CurrentTransaction = p_txTransaction;
				EnlistedPluginRegistry = p_prgPluginRegistry;
			}
Esempio n. 5
0
			/// <summary>
			/// Initializes a new instance of the <see cref="TxEnlistment"/> class.
			/// </summary>
			/// <param name="tx">The Transaction.</param>
			public TxEnlistment(Transaction tx)
			{
				_tx = tx;
				_journal = new List<RollbackOperation>();
			}