using System; using System.Reflection; using Caliburn.Services; using Spring.Context; using Spring.Context.Support; namespace Caliburn.Spring { public class SpringAdapter : IContainer { private readonly GenericApplicationContext _context; public SpringAdapter(GenericApplicationContext context) { _context = context; } public IApplicationContext Context { get { return _context; } } #region IContainer Members public virtual object Resolve(Type type) { return _context.GetObject(type.FullName); } public virtual object Resolve(string key) { return _context.GetObject(key); } public virtual object Resolve(Type serviceType, string key) { return _context.GetObject(key, serviceType); } public virtual void LoadFrom(Assembly assembly) { throw new NotImplementedException(); } #endregion } }