Missing things

Apr 17, 2009 at 5:46 PM
Where are :

  • System.ComponentModel.Composition.INotifyImportSatisfaction
  • ImportRequiredMetadataAttribute

I couldn't find them.

Is there more things that have change name, location or whatever? I'm becoming crazy.



Apr 17, 2009 at 5:56 PM
Hey there!

Check out the release notes for preview 5: http://mef.codeplex.com/SourceControl/ListDownloadableCommits.aspx

You'll find your answers there!

Cheers,

M.

On Fri, Apr 17, 2009 at 6:47 PM, vtortolaNET <notifications@codeplex.com> wrote:

From: vtortolaNET

Where are :

  • System.ComponentModel.Composition.INotifyImportSatisfaction
  • ImportRequiredMetadataAttribute

I couldn't find them.

Is there more things that have change name, location or whatever? I'm becoming crazy.


Apr 17, 2009 at 6:22 PM
Hi,

That doesn't say anything about ImportRequiredMetadataAttribute :P
Developer
Apr 19, 2009 at 3:38 AM
Yes ImportRequiredMetadataAttribute has been removed completely, we should add that to the release notes. If you need similar behavior then you should use a metadata view. For example:

public interface IMyCustomMetadata
{
    string Name;
}

...
[Import]
public Export<IMyContract, IMyCustomMetadata> MyContract { get; set; }
...

What this does is allow you to import the type IMyContract and have a strongly typed metadata view of type IMyCustomMetadata. In doing this it will take the public property names from the metadata view and they will be required metadata keys for the import.

Hope that helps.
Apr 21, 2009 at 8:02 PM
Great, thanks!
May 1, 2009 at 4:42 PM
how do i access the metadata from the exportcollection?
May 1, 2009 at 5:39 PM

Import an array of Export<T, TMetadata>, e.g.:

[Import]

Export<Foo, IFooMetadata>[] Foos { get; set; }

Each element in the array will carry its metadata, e.g.:

Console.WriteLine(Foos[0].MetadataView.SomeMetadataValue);

There’s some info on the wiki here: http://mef.codeplex.com/Wiki/View.aspx?title=Strongly%20typed%20Metadata&referringTitle=Home

Hope this helps,

Nick

From: ccyvas [mailto:notifications@codeplex.com]
Sent: Friday, May 01, 2009 8:42 AM
To: Nicholas Blumhardt
Subject: Re: Missing things [MEF:53661]

From: ccyvas

how do i access the metadata from the exportcollection?

Read the full discussion online.

To add a post to this discussion, reply to this email (MEF@discussions.codeplex.com)

To start a new discussion for this project, email MEF@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com

May 1, 2009 at 6:22 PM
most excellent! Worked a treat! Thank you!