2 using System.ComponentModel.Composition.Hosting;
3 using System.Diagnostics;
4 using System.Reflection;
5 using System.ComponentModel.Composition;
7 namespace Pithos.ShellExtensions
11 public CompositionContainer Container;
13 static readonly Lazy<IoC> Instance=new Lazy<IoC>();
15 public static IoC Current
17 get { return Instance.Value; }
22 var catalog = new AggregateCatalog();
23 catalog.Catalogs.Add(new AssemblyCatalog(Assembly.GetExecutingAssembly()));
25 Container=new CompositionContainer(catalog);
30 public T Compose<T>(T target)
34 Container.ComposeParts(target);
39 Trace.TraceError(exc.ToString());