1
我正在使用MEF。我的应用程序是开放式的,但我仍然希望将它从扩展它的人中隐藏起来。导入一个类而不导出它
例如BaseAssembly有
public class ListContainer
{
[ImportMany(typeof(IBase))]
public List<IBase> MyObjects { get; set; }
public void AssembleDriverComponents()
{
.... Some code to create catalogue..
//Crete the composition container
var container = new CompositionContainer(aggregateCatalog);
// Composable parts are created here i.e. the Import and Export components assembles here
container.ComposeParts(this);
}
}
其他组件将指基座组件。
ReferenceAssembly将有
[Export(typeof(IBase))]
public class MyDerived
{
public MyDerived()
{ }
}
我想避免这种属性,它是在引用的程序集派生类。
可能吗?
是的..我认为它应该适合我。 –