#region CPL License
/*
Nuclex Framework
Copyright (C) 2002-2010 Nuclex Development Labs
This library is free software; you can redistribute it and/or
modify it under the terms of the IBM Common Public License as
published by the IBM Corporation; either version 1.0 of the
License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
IBM Common Public License for more details.
You should have received a copy of the IBM Common Public
License along with this library
*/
#endregion
using System;
using System.Collections.Generic;
using System.Reflection;
using Nuclex.Support.Plugins;
#if ENABLE_SERVICEMANAGER
namespace Nuclex.Support.Services {
///
/// Lists the types of all assemblies contained in an assembly repository
///
public class RepositoryTypeLister : MultiAssemblyTypeLister {
///
/// Initializes a new repository type lister using a new repository
///
public RepositoryTypeLister() : this(new PluginRepository()) { }
///
/// Initializes a new repository type lister using an existing repository
///
///
/// Repository containing the assemblies whose types will be listed
///
public RepositoryTypeLister(PluginRepository repository) {
this.repository = repository;
}
///
/// Returns an enumerable list of the assemblies in the repository
///
/// An enumerable list of the assemblies in the repository
protected override IEnumerable GetAssemblies() {
return this.repository.LoadedAssemblies;
}
///
/// The assembly repository containing the assemblies whose types the lister
/// operates on.
///
public PluginRepository Repository {
get { return this.repository; }
}
///
/// Repository containing the assemblies with the type lister's types
///
private PluginRepository repository;
}
} // namespace Nuclex.Support.Services
#endif // ENABLE_SERVICEMANAGER