/// <summary>
        /// Method for disposing object references, only if all other references
        /// to this class have already been disposed.  This also disposes
        /// managed resources.
        /// </summary>
        /// <param name="disposing">
        /// Flag for indicating that this was called from the public <see cref="Dispose()"/>
        /// method, and thus we really do want to dispose this class reference.
        /// </param>
        private void Dispose(Boolean disposing)
        {
            if (_isDisposed) {
                return;
            }

            if (this._plugins != null) {
                lock (this._plugins) {
                    foreach (AvailablePlugin p in this._plugins) {
                        if ((p.Instance.Initialized) || (!p.Instance.IsDisposed)) {
                            p.Instance.Dispose();
                        }
                    }
                    this._plugins.Clear();
                }
                this._plugins = null;
            }

            if (disposing) {
                lock (_padlock) {
                    if (_refCount == 0) {
                        _instance = null;
                    }
                }
            }

            this._serializationInfo = null;
            _isDisposed = true;
            _initialized = false;
        }
 /// <summary>
 /// Determines if the specified <b>AvailablePlugins</b> collection is
 /// null or empty.
 /// </summary>
 /// <param name="collection">
 /// The <b>AvailablePlugins</b> collection to check.
 /// </param>
 /// <returns>
 /// true if the specified collection is null or empty; Otherwise, false.
 /// </returns>
 public static Boolean IsNullOrEmpty(AvailablePluginCollection collection)
 {
     return ((collection == null) || (collection.Count == 0));
 }
 /// <summary>
 /// Initializes the plugin manager.
 /// </summary>
 public void Initialize()
 {
     if (_initialized) {
         return;
     }
     this._plugins = new AvailablePluginCollection();
     _initialized = true;
 }