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()
    { }
}

参照されたアセンブリの派生クラスにあるこの属性を避けたいです。

出来ますか?

4

1 に答える 1