The log that tracks the order of plugins.
The plugin order log can only be accessed by one install task at a time, so this object is a singleton to help enforce that policy. Note, however, that the singleton nature of the log is not meant to provide global access to the object. As such, there is no static accessor to retrieve the singleton instance. Instead, the Initialize method returns the only instance that should be used.
Inheritance: IPluginOrderLog
		/// <summary>
		/// Initializes the plugin log.
		/// </summary>
		/// <param name="p_mprManagedPluginRegistry">The <see cref="PluginRegistry"/> that contains the list
		/// of managed <see cref="Plugin"/>s.</param>
		/// <param name="p_posOrderSerializer">The object that serializes and deserializes
		/// data from an active plugin log permanent store.</param>
		/// <param name="p_povOrderValidator">The object that validates plugin order.</param>
		/// <exception cref="InvalidOperationException">Thrown if the plugin order log has already
		/// been initialized.</exception>
		public static PluginOrderLog Initialize(PluginRegistry p_mprManagedPluginRegistry, IPluginOrderLogSerializer p_posOrderSerializer, IPluginOrderValidator p_povOrderValidator)
		{
			if (m_polCurrent != null)
				throw new InvalidOperationException("The Plugin Order Log has already been initialized.");
			m_polCurrent = new PluginOrderLog(p_mprManagedPluginRegistry, p_posOrderSerializer, p_povOrderValidator);
			return m_polCurrent;
		}
Example #2
0
 /// <summary>
 /// Initializes the plugin log.
 /// </summary>
 /// <param name="p_mprManagedPluginRegistry">The <see cref="PluginRegistry"/> that contains the list
 /// of managed <see cref="Plugin"/>s.</param>
 /// <param name="p_posOrderSerializer">The object that serializes and deserializes
 /// data from an active plugin log permanent store.</param>
 /// <param name="p_povOrderValidator">The object that validates plugin order.</param>
 /// <exception cref="InvalidOperationException">Thrown if the plugin order log has already
 /// been initialized.</exception>
 public static PluginOrderLog Initialize(PluginRegistry p_mprManagedPluginRegistry, IPluginOrderLogSerializer p_posOrderSerializer, IPluginOrderValidator p_povOrderValidator)
 {
     if (m_polCurrent != null)
     {
         throw new InvalidOperationException("The Plugin Order Log has already been initialized.");
     }
     m_polCurrent = new PluginOrderLog(p_mprManagedPluginRegistry, p_posOrderSerializer, p_povOrderValidator);
     return(m_polCurrent);
 }
Example #3
0
            /// <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_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>
		/// This disposes of the singleton object, allowing it to be re-initialized.
		/// </summary>
		public void Release()
		{
			m_polCurrent = null;
		}
Example #6
0
 /// <summary>
 /// This disposes of the singleton object, allowing it to be re-initialized.
 /// </summary>
 public void Release()
 {
     m_polCurrent = null;
 }