New test.
[mono.git] / mcs / class / System.Web.Mvc2 / System.Web.Mvc / ResultExecutingContext.cs
1 /* ****************************************************************************\r
2  *\r
3  * Copyright (c) Microsoft Corporation. All rights reserved.\r
4  *\r
5  * This software is subject to the Microsoft Public License (Ms-PL). \r
6  * A copy of the license can be found in the license.htm file included \r
7  * in this distribution.\r
8  *\r
9  * You must not remove this notice, or any other, from this software.\r
10  *\r
11  * ***************************************************************************/\r
12 \r
13 namespace System.Web.Mvc {\r
14     using System;\r
15     using System.Diagnostics.CodeAnalysis;\r
16 \r
17     public class ResultExecutingContext : ControllerContext {\r
18 \r
19         // parameterless constructor used for mocking\r
20         public ResultExecutingContext() {\r
21         }\r
22 \r
23         [SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors",\r
24             Justification = "The virtual property setters are only to support mocking frameworks, in which case this constructor shouldn't be called anyway.")]\r
25         public ResultExecutingContext(ControllerContext controllerContext, ActionResult result)\r
26             : base(controllerContext) {\r
27             if (result == null) {\r
28                 throw new ArgumentNullException("result");\r
29             }\r
30 \r
31             Result = result;\r
32         }\r
33 \r
34         public bool Cancel {\r
35             get;\r
36             set;\r
37         }\r
38 \r
39         public virtual ActionResult Result {\r
40             get;\r
41             set;\r
42         }\r
43 \r
44     }\r
45 }\r