import - MEF: "A Composable Part should contain at least one EXPORT" -



import - MEF: "A Composable Part should contain at least one EXPORT" -

from official mef documentation:

a composable part should contain @ to the lowest degree 1 export. composable parts either added container explicity or created through utilize of catalogs. default catalogs mef ship identify composable parts through presence of export attribute.

does mean snippet form same documentation not work, when using default catalogs, since doesn't export anything?

class programme { [import] public imessagesender messagesender { get; set; } }

i find hard believe classes participating in mef mix, must 'bring nutrient table', if want 'consume'. program above beingness simple example: there nil class add together mef mix.

secondly, how parts beingness added "explicitly container"? documentation of e.g. compositioncontainer doesn't help me further.

thanks in advance jan

a composable part part can imported part. illustration here:

class programme { [import] public imessagesender messagesender { get; set; } }

program not composable part. iself not automatically imported part. exports imessagesender composable parts.

you can add together parts explicity container using compositionbatch, allows add together export , composablepart instances container explicitly, or through extension can add together raw values:

var user = new user() { name = "matt" }; var batch = new compositionbatch(); batch.addexportedvalue(user); compositioncontainer.compose(batch);

where final phone call adding parts container.

import export mef catalog

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

intellij idea - Update external libraries with intelij and java -

javascript - send data from a new window to previous window in php -