本文整理汇总了C#中ServiceContainer.AddSubContainer方法的典型用法代码示例。如果您正苦于以下问题:C# ServiceContainer.AddSubContainer方法的具体用法?C# ServiceContainer.AddSubContainer怎么用?C# ServiceContainer.AddSubContainer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ServiceContainer
的用法示例。
在下文中一共展示了ServiceContainer.AddSubContainer方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetUp
public void SetUp()
{
_singleContainer = new ServiceContainer();
_mainContainer = new ServiceContainer();
_subContainer1 = new ServiceContainer();
_subContainer2 = new ServiceContainer();
_innerSubContainer = new ServiceContainer();
_mainContainer.AddSubContainer(_subContainer1);
_mainContainer.AddSubContainer(_subContainer2);
_subContainer1.AddSubContainer(_innerSubContainer);
}
示例2: ResolveNameTypeServicesInComplexContainer
public void ResolveNameTypeServicesInComplexContainer()
{
IServiceContainer mainContainer = new ServiceContainer();
IServiceContainer subContainer = new ServiceContainer();
mainContainer.AddSubContainer(subContainer);
mainContainer.AddSimpleValueComponent("some name", new Object());
subContainer.AddSimpleValueComponent("some other value");
mainContainer.AddSimpleValueComponent("key1", "IDDQD");
subContainer.AddSimpleValueComponent("key2", "IDKFA");
mainContainer.AddSimpleValueComponent("key3", new SomeData("IDCLIP"));
TestCommonBody(mainContainer, new[] {"IDDQD", "IDKFA"});
}