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()
{ }
}
해야합니다.
가능합니까?
예 .. 제 생각에 그것이 저에게 효과적이라고 생각합니다. –