代码改变世界

Caliburn v2 变更-容器

2010-03-08 10:43  Clingingboy  阅读(712)  评论(0编辑  收藏  举报

做记录…   
对容器进行了重构,命名空间进行了调整,为Caliburn.Core.IoC

添加了IRegistry接口,用于注册,之前没有接口用于注册,只能是从容器中取

/// <summary>
/// Implemented by a class that can register components with an IoC container.
/// </summary>
public interface IRegistry
{
    /// <summary>
    /// Configures the container using the provided component registrations.
    /// </summary>
    /// <param name="registrations">The component registrations.</param>
    void Register(IEnumerable<IComponentRegistration> registrations);
}

 

SimpleContainer类为默认实现,ContainerBase为基础,可以用ContainerBase实现适配.虽然内部发生变化,但使用起来变化不大

注意:PerRequestAttribute等Attribute命名空间进行了调整,也为Caliburn.Core.IoC,此处有影响