Пример #1
0
        /// <summary>
        /// Unregister a plugin. If you unregister the current logging or calc
        /// plugin, a new system one will be created. Encog will crash without a
        /// logging or system plugin.
        /// </summary>
        public void UnregisterPlugin(EncogPluginBase plugin)
        {
            // is it a special plugin?
            // if so, replace with the system, Encog will crash without these
            if (plugin == _loggingPlugin)
            {
                _loggingPlugin = new SystemLoggingPlugin();
            }

            // remove it
            _plugins.Remove(plugin);
        }
Пример #2
0
 /// <summary>
 /// Register a plugin. If this plugin provides a core service, such as
 /// calculation or logging, this will remove the old plugin.
 /// </summary>
 ///
 /// <param name="plugin">The plugin to register.</param>
 public void RegisterPlugin(EncogPluginBase plugin)
 {
     // is it not a general plugin?
     if (plugin.PluginServiceType != EncogPluginBaseConst.SERVICE_TYPE_GENERAL)
     {
         if (plugin.PluginServiceType == EncogPluginBaseConst.SERVICE_TYPE_LOGGING)
         {
             // remove the old logging plugin
             if (_loggingPlugin != null)
             {
                 _plugins.Remove(_loggingPlugin);
             }
             _loggingPlugin = (IEncogPluginLogging1)plugin;
         }
     }
     // add to the plugins
     _plugins.Add(plugin);
 }
Пример #3
0
        /// <summary>
        /// Unregister a plugin. If you unregister the current logging or calc
        /// plugin, a new system one will be created. Encog will crash without a
        /// logging or system plugin.
        /// </summary>
        public void UnregisterPlugin(EncogPluginBase plugin)
        {
            // is it a special plugin?
            // if so, replace with the system, Encog will crash without these
            if (plugin == _loggingPlugin)
            {
                _loggingPlugin = new SystemLoggingPlugin();
            }

            // remove it
            _plugins.Remove(plugin);
        }
Пример #4
0
        /// <summary>
        /// Register a plugin. If this plugin provides a core service, such as
        /// calculation or logging, this will remove the old plugin.
        /// </summary>
        ///
        /// <param name="plugin">The plugin to register.</param>
        public void RegisterPlugin(EncogPluginBase plugin)
        {
            // is it not a general plugin?
            //if (plugin.PluginServiceType != EncogPluginBaseConst.SERVICE_TYPE_GENERAL)
            //{
            //    if (plugin.PluginServiceType == EncogPluginBaseConst.SERVICE_TYPE_LOGGING)
            //    {
            //        // remove the old logging plugin
            //        if (_loggingPlugin != null)
            //        {
            //            _plugins.Remove(_loggingPlugin);
            //        }
            //        _loggingPlugin = (IEncogPluginLogging1) plugin;
            //    }
            //}

            if (plugin.PluginServiceType != ServiceType.GENERAL)
            {
                if (plugin.PluginServiceType == ServiceType.LOGGING)
                {
                    // remove the old logging plugin
                    if (_loggingPlugin != null)
                    {
                        _plugins.Remove(_loggingPlugin);
                    }
                    _loggingPlugin = (IEncogPluginLogging1)plugin;
                }
            }
            // add to the plugins
            _plugins.Add(plugin);
        }
Пример #5
0
 public void RegisterPlugin(EncogPluginBase plugin)
 {
     if ((plugin.PluginServiceType == 0) || (plugin.PluginServiceType != 1))
     {
         goto Label_0029;
     }
     Label_000A:
     if (this._xae206eda292f3e91 != null)
     {
         this._xdd29f42de85b003a.Remove(this._xae206eda292f3e91);
     }
     this._xae206eda292f3e91 = (IEncogPluginLogging1) plugin;
     Label_0029:
     this._xdd29f42de85b003a.Add(plugin);
     if (0 == 0)
     {
         return;
     }
     goto Label_000A;
 }
Пример #6
0
 public void UnregisterPlugin(EncogPluginBase plugin)
 {
     if (plugin == this._xae206eda292f3e91)
     {
         this._xae206eda292f3e91 = new SystemLoggingPlugin();
     }
     this._xdd29f42de85b003a.Remove(plugin);
 }