Castle.MicroKernel.Context.CreationContext.EnterResolutionContext C# (CSharp) Méthode

EnterResolutionContext() public méthode

public EnterResolutionContext ( IHandler handlerBeingResolved, bool requiresDecommission ) : ResolutionContext
handlerBeingResolved IHandler
requiresDecommission bool
Résultat ResolutionContext
		public ResolutionContext EnterResolutionContext(IHandler handlerBeingResolved, bool requiresDecommission)
		{
			return EnterResolutionContext(handlerBeingResolved, true, requiresDecommission);
		}

Same methods

CreationContext::EnterResolutionContext ( IHandler handlerBeingResolved, bool trackContext, bool requiresDecommission ) : ResolutionContext

Usage Example

		protected override object ResolveCore(CreationContext context, bool track, bool instanceRequired)
		{
			Type implType;
			try
			{
				implType = ComponentModel.Implementation.MakeGenericType(context.GenericArguments);
			}
			catch (ArgumentException)
			{
				// may throw in some cases when impl has generic constraints that service hasn't
				if(instanceRequired)
				{
					throw;
				}
				return null;
			}

			var handler = GetSubHandler(context, implType);

			// so the generic version wouldn't be considered as well
			using(context.EnterResolutionContext(this, false))
			{
				return handler.Resolve(context);
			}
		}
All Usage Examples Of Castle.MicroKernel.Context.CreationContext::EnterResolutionContext