/// <summary>
        /// Adds a plugin source to the repository.
        /// </summary>
        /// <param name="source">The source.</param>
        /// <exception cref="System.ArgumentNullException">source</exception>
        /// <exception cref="System.ArgumentException">Source already added</exception>
        public void AddPluginSource(IPluginSource source)
        {
            if (source == null)
            throw new ArgumentNullException("source");

              if (this.sources.Contains(source))
            throw new ArgumentException(Resources.SourceAlreadyAdded);

              source.PluginAdded += this.OnPluginAdded;
              source.PluginRemoved += this.OnPluginRemoved;

              this.sources.Add(source);

              this.log.Debug(Resources.SourceAdded, source.GetType().FullName);
        }
Esempio n. 2
0
        /// <summary>
        /// Removes a plugin source from the repository.
        /// </summary>
        /// <param name="source">The source.</param>
        public void RemovePluginSource(IPluginSource source)
        {
            if (source == null)
            {
                throw new ArgumentNullException("source");
            }

            if (!this.sources.Contains(source))
            {
                throw new ArgumentException(Resources.UnknownSource);
            }

            this.sources.Remove(source);
            source.PluginAdded   -= this.OnPluginAdded;
            source.PluginRemoved -= this.OnPluginRemoved;

            this.log.Debug(Resources.SourceRemoved, source.GetType().FullName);
        }
Esempio n. 3
0
        /// <summary>
        /// Adds a plugin source to the repository.
        /// </summary>
        /// <param name="source">The source.</param>
        /// <exception cref="System.ArgumentNullException">source</exception>
        /// <exception cref="System.ArgumentException">Source already added</exception>
        public void AddPluginSource(IPluginSource source)
        {
            if (source == null)
            {
                throw new ArgumentNullException("source");
            }

            if (this.sources.Contains(source))
            {
                throw new ArgumentException(Resources.SourceAlreadyAdded);
            }

            source.PluginAdded   += this.OnPluginAdded;
            source.PluginRemoved += this.OnPluginRemoved;

            this.sources.Add(source);

            this.log.Debug(Resources.SourceAdded, source.GetType().FullName);
        }
        /// <summary>
        /// Removes a plugin source from the repository.
        /// </summary>
        /// <param name="source">The source.</param>
        public void RemovePluginSource(IPluginSource source)
        {
            if (source == null)
            throw new ArgumentNullException("source");

              if (!this.sources.Contains(source))
            throw new ArgumentException(Resources.UnknownSource);

              this.sources.Remove(source);
              source.PluginAdded -= this.OnPluginAdded;
              source.PluginRemoved -= this.OnPluginRemoved;

              this.log.Debug(Resources.SourceRemoved, source.GetType().FullName);
        }