本文整理汇总了C#中IContainer.GetType方法的典型用法代码示例。如果您正苦于以下问题:C# IContainer.GetType方法的具体用法?C# IContainer.GetType怎么用?C# IContainer.GetType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IContainer
的用法示例。
在下文中一共展示了IContainer.GetType方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RegisterContainer
public virtual void RegisterContainer(IContainer container)
{
if (container == null)
throw new ArgumentNullException("container");
String key = container.GetType().FullName;
RegisterContainer(key, container);
}
示例2: ConfigureContainer
/// <summary>
/// When overridden in a derived class, configures the container.
/// </summary>
/// <param name="containerName">Name of the container to configure.</param>
/// <param name="container">Container instance to configure.</param>
protected override void ConfigureContainer(string containerName, IContainer container)
{
var containerWrapper = container as UnityContainerWrapper;
if (null == containerWrapper)
{
throw new ArgumentException($"Unable to configure container of type '{container.GetType()}'.");
}
var unitySection = ConfigurationManager.GetSection("unity") as UnityConfigurationSection;
if (null == unitySection)
{
return;
}
if (string.IsNullOrWhiteSpace(containerName))
{
containerWrapper.Container.LoadConfiguration(unitySection);
return;
}
containerWrapper.Container.LoadConfiguration(unitySection, containerName);
}
示例3: RegisteredContainer
internal void RegisteredContainer(string configurationType, IContainer container)
{
if (IsEnabled())
RegisteredContainer(configurationType, container.GetType().ToString(), Thread.CurrentThread.ManagedThreadId, GetTask());
}
示例4: RegisteredContainer
internal void RegisteredContainer(string configurationType, IContainer container)
{
if (IsEnabled())
RegisteredContainer(configurationType, container.GetType().Name);
}