42 lines
No EOL
1.1 KiB
C#
42 lines
No EOL
1.1 KiB
C#
using System.Collections.Generic;
|
|
using System.Reflection;
|
|
using JD.Collections;
|
|
using JD.LogService;
|
|
using JD.Reflection.MefImplementations.Hosting;
|
|
|
|
namespace JD.TeaBoxAddinSystem.Addins.MEF
|
|
{
|
|
internal class EmptyAddinService : IAddinService
|
|
{
|
|
#region Variables
|
|
|
|
private readonly CompositionContainer m_container = new CompositionContainer(new TypeCatalog());
|
|
|
|
#endregion
|
|
|
|
#region Implementation
|
|
|
|
public IEnumerable<IAddin> Addins
|
|
{
|
|
get { yield break; }
|
|
}
|
|
|
|
public void Compose(object part)
|
|
{
|
|
// Has the nice side-effect of instantiating enumerables & arrays
|
|
m_container.SatisfyImportsOnce(part);
|
|
}
|
|
|
|
/// <summary>
|
|
/// The assemblies that are gathered from external sources (like script for example).
|
|
/// </summary>
|
|
public ObservableList<Assembly> DynamicAssemblies { get { return new ObservableList<Assembly>(); } }
|
|
|
|
public bool Validate(ILogger logger)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
#endregion
|
|
}
|
|
} |