MVC3 integrated, with some changes to make it compile on Mono and with Razor2
[mono-project.git] / mcs / class / System.Web.Mvc3 / Mvc / Filter.cs
blob1d239bc073b39b32182f2a46f19e9e6514cee459
1 namespace System.Web.Mvc {
2 using System.Diagnostics.CodeAnalysis;
4 public class Filter {
5 public const int DefaultOrder = -1;
7 public Filter(object instance, FilterScope scope, int? order) {
8 if (instance == null) {
9 throw new ArgumentNullException("instance");
12 if (order == null) {
13 IMvcFilter mvcFilter = instance as IMvcFilter;
14 if (mvcFilter != null) {
15 order = mvcFilter.Order;
19 Instance = instance;
20 Order = order ?? DefaultOrder;
21 Scope = scope;
24 public object Instance {
25 get;
26 protected set;
29 public int Order {
30 get;
31 protected set;
34 public FilterScope Scope {
35 get;
36 protected set;