コード例 #1
0
ファイル: Controller.cs プロジェクト: ralescano/castle
		private void CreateAndProcessRescueController(RescueDescriptor desc, Exception actionException)
		{
			IController rescueController = engineContext.Services.ControllerFactory.CreateController(desc.RescueController);

			ControllerMetaDescriptor rescueControllerMeta =
				engineContext.Services.ControllerDescriptorProvider.BuildDescriptor(rescueController);

			ControllerDescriptor rescueControllerDesc = rescueControllerMeta.ControllerDescriptor;

			IControllerContext rescueControllerContext = engineContext.Services.ControllerContextFactory.Create(
				rescueControllerDesc.Area, rescueControllerDesc.Name, desc.RescueMethod.Name,
				rescueControllerMeta);

			rescueControllerContext.CustomActionParameters["exception"] = actionException;
			rescueControllerContext.CustomActionParameters["controller"] = this;
			rescueControllerContext.CustomActionParameters["controllerContext"] = ControllerContext;

			rescueController.Process(engineContext, rescueControllerContext);
		}