2010-06-21 Marek Habersack <mhabersack@novell.com>
[mcs.git] / class / System.Web.Mvc / System.Web.Mvc / ActionExecutedContext.cs
blob1dfaa174b16b13298356dcea5e4af17c0233c184
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 {
14 using System;
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;
34 Canceled = canceled;
35 Exception = exception;
38 public virtual ActionDescriptor ActionDescriptor {
39 get;
40 set;
43 public virtual bool Canceled {
44 get;
45 set;
48 public virtual Exception Exception {
49 get;
50 set;
53 public bool ExceptionHandled {
54 get;
55 set;
58 public ActionResult Result {
59 get {
60 return _result ?? EmptyResult.Instance;
62 set {
63 _result = value;