예제 #1
0
 /// <summary>
 /// Initialise all the plugins.
 /// 
 /// Every available plugin (added with <see cref="AddPlugin"/> or <see cref="LoadPlugins"/>)
 /// that is not marked as disabled will be initialised.
 /// </summary>
 public void InitialisePlugins()
 {
     MasterObjectTable mot = Locator.Current.GetService<MasterObjectTable>();
     lock (m_pluginsAvailable)
     {
         lock(m_pluginsEnabled)
         {
             foreach (Guid uuid in m_pluginsAvailable.Keys)
             {
                 // Create the IPluginHost for this plugin and enable it
                 PluginHost host = new PluginHost(m_pluginsAvailable[uuid]);
                 if (host.EnablePlugin())
                 {
                     this.Log().Debug("Enabled plugin {0} (ID = '{1}')", m_pluginsAvailable[uuid].GetType().Name, m_pluginsAvailable[uuid].UUID);
                     m_pluginsEnabled[uuid] = host;
                     mot.AddInstance(m_pluginsAvailable[uuid]);
                 }
             }
         }
     }
 }
예제 #2
0
        /// <summary>
        /// Initialise all the plugins.
        ///
        /// Every available plugin (added with <see cref="AddPlugin"/> or <see cref="LoadPlugins"/>)
        /// that is not marked as disabled will be initialised.
        /// </summary>
        public void InitialisePlugins()
        {
            MasterObjectTable mot = Locator.Current.GetService <MasterObjectTable>();

            lock (m_pluginsAvailable)
            {
                lock (m_pluginsEnabled)
                {
                    foreach (Guid uuid in m_pluginsAvailable.Keys)
                    {
                        // Create the IPluginHost for this plugin and enable it
                        PluginHost host = new PluginHost(m_pluginsAvailable[uuid]);
                        if (host.EnablePlugin())
                        {
                            this.Log().Debug("Enabled plugin {0} (ID = '{1}')", m_pluginsAvailable[uuid].GetType().Name, m_pluginsAvailable[uuid].UUID);
                            m_pluginsEnabled[uuid] = host;
                            mot.AddInstance(m_pluginsAvailable[uuid]);
                        }
                    }
                }
            }
        }