开发者

Where UnityContainerElement in Unity 2?

开发者 https://www.devze.com 2022-12-28 23:21 出处:网络
I was in Unity 1.2, use the following code: UnityConfigurationSection UnitySection = (UnityConfigurationSection)ConfigurationManager.GetSection(\"Unity\");

I was in Unity 1.2, use the following code:

UnityConfigurationSection UnitySection = (UnityConfigurationSection)ConfigurationManager.GetSection("Unity");
Dicti开发者_JAVA百科onary<string, IUnityContainer> Containers = new Dictionary<string, IUnityContainer>();

foreach (UnityContainerElement element in UnitySection.Containers)
{
    IUnityContainer container = new UnityContainer();
    Containers.Add(element.Name, container);
    element.Configure(Containers[element.Name]);
}

but, I couldn't do so in the Unity 2.0 beta2, because The class 'UnityContainerElement' does not exist in Unity 2 beta2.

How can I do this in the new version?


It have been renamed to ContainerElement.

0

精彩评论

暂无评论...
验证码 换一张
取 消