Files
29WxOrder/Source/MAX.Framework/PrismExtension/Prism.Autofac/PrismBootstrapper.cs
T
2026-08-31 16:28:23 +08:00

32 lines
1.0 KiB
C#

using Prism.Ioc;
using System;
using AutofacCore = Autofac.Core;
namespace Prism.Autofac
{
/// <summary>
/// Base bootstrapper class that uses <see cref="UnityContainerExtension"/> as it's container.
/// </summary>
public abstract class PrismBootstrapper : PrismBootstrapperBase
{
/// <summary>
/// Create a new <see cref="UnityContainerExtension"/> used by Prism.
/// </summary>
/// <returns>A new <see cref="UnityContainerExtension"/>.</returns>
protected override IContainerExtension CreateContainerExtension()
{
return new AutofacContainerExtension();
}
/// <summary>
/// Registers the <see cref="Type"/>s of the Exceptions that are not considered
/// root exceptions by the <see cref="ExceptionExtensions"/>.
/// </summary>
protected override void RegisterFrameworkExceptionTypes()
{
ExceptionExtensions.RegisterFrameworkExceptionType(typeof(AutofacCore.DependencyResolutionException));
ExceptionExtensions.RegisterFrameworkExceptionType(typeof(AutofacCore.Registration.ComponentNotRegisteredException));
}
}
}