Guide to writing filtered/custom catalogs?

Oct 27, 2009 at 10:47 AM

I used a networkawarecatalog (a catalog that uses System.Net.NetworkInformation to decide which export to use) from a videocast, but its broken under preview 7 and 8. It seems the INotifyComposablePartCatalogChanged has changed, along with ComposablePartCatalogChangeEventArgs. I need the functionality of the networkawarecatalog including the possibility of recomposition, but don't want to downgrade my MEF version. So now I figured i might aswell write one myself, but I couldn't figure out where to begin with custom/filtered catalogs? Which leads me to this: Is there any well-written thorough guide to writing custom and filtered catalogs?

Kind regards

Developer
Oct 27, 2009 at 11:13 PM

There is a sample FilteredCatalog at http://mef.codeplex.com/wikipage?title=Filtering%20Catalogs&referringTitle=Guide but as far as writing a custom catalog we don't have a guide for that at this point. We should write something up on it though because it can be very tricky, particularly mutable catalogs in the face of rejection. In the mean time perhaps you can try to see if you can get by with the FilteredCatalog sample in combination with the AggregateCatalog.

Oct 28, 2009 at 8:18 AM

I'll give that a look, thanks :)