New test.
[mono.git] / mcs / class / System.Web.Mvc2 / System.Web.Mvc / AuthorizationContext.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 AuthorizationContext : ControllerContext {\r
18 \r
19         // parameterless constructor used for mocking\r
20         public AuthorizationContext() {\r
21         }\r
22 \r
23         [Obsolete("The recommended alternative is the constructor AuthorizationContext(ControllerContext controllerContext, ActionDescriptor actionDescriptor).")]\r
24         public AuthorizationContext(ControllerContext controllerContext)\r
25             : base(controllerContext) {\r
26         }\r
27 \r
28         [SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors",\r
29             Justification = "The virtual property setters are only to support mocking frameworks, in which case this constructor shouldn't be called anyway.")]\r
30         public AuthorizationContext(ControllerContext controllerContext, ActionDescriptor actionDescriptor)\r
31             : base(controllerContext) {\r
32             if (actionDescriptor == null) {\r
33                 throw new ArgumentNullException("actionDescriptor");\r
34             }\r
35 \r
36             ActionDescriptor = actionDescriptor;\r
37         }\r
38 \r
39         public virtual ActionDescriptor ActionDescriptor {\r
40             get;\r
41             set;\r
42         }\r
43 \r
44         public ActionResult Result {\r
45             get;\r
46             set;\r
47         }\r
48 \r
49     }\r
50 }\r