CodePaste Logo
New Snippet New Snippet Recent Snippets Recent Snippets My Snippets My Snippets Web Code Search Snippets Search
Sign inor Register
Language: C#

Container scoping example

296 Views
Copy Code Show/Hide Line Numbers
 
var catalog = new DirectoryCatalog(@".\");
var rootCatalog = new FilteredCatalog(catalog, cpd=>!cpd.Metadata.ContainsKey("Scope") || (cpd.Metadata.ContainsKey("Scope") && cpd.Metadata["Scope"].Equals("Root"));
var childCatalog = new FilteredCatalog(catalog, cpd=>cpd.Metadata.ContainsKey("Scope") && cpd.Metadata["Scope"].Equals("Child"));
var rootContainer = new CompositionContainer(rootCatalog);
var childContainer = new CompositionContainer(childCatalog, rootContainer);
 
by Glenn Block
  January 04, 2010 @ 12:09am
Tags:

Add a comment


Report Abuse
brought to you by:
West Wind Techologies



If you find this site useful and use it frequently please consider making a donation to support this free service.
Donate