1
/* ****************************************************************************
3 * Copyright (c) Microsoft Corporation. All rights reserved.
5 * This software is subject to the Microsoft Public License (Ms-PL).
6 * A copy of the license can be found in the license.htm file included
7 * in this distribution.
9 * You must not remove this notice, or any other, from this software.
11 * ***************************************************************************/
13 namespace System
.Web
.Mvc
{
15 using System
.Diagnostics
.CodeAnalysis
;
17 public class ActionExecutedContext
: ControllerContext
{
19 private ActionResult _result
;
21 // parameterless constructor used for mocking
22 public ActionExecutedContext() {
25 [SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors",
26 Justification
= "The virtual property setters are only to support mocking frameworks, in which case this constructor shouldn't be called anyway.")]
27 public ActionExecutedContext(ControllerContext controllerContext
, ActionDescriptor actionDescriptor
, bool canceled
, Exception exception
)
28 : base(controllerContext
) {
29 if (actionDescriptor
== null) {
30 throw new ArgumentNullException("actionDescriptor");
33 ActionDescriptor
= actionDescriptor
;
35 Exception
= exception
;
38 public virtual ActionDescriptor ActionDescriptor
{
43 public virtual bool Canceled
{
48 public virtual Exception Exception
{
53 public bool ExceptionHandled
{
58 public ActionResult Result
{
60 return _result
?? EmptyResult
.Instance
;