1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
|
namespace System.Web.Mvc {
using System.Diagnostics.CodeAnalysis;
public class Filter {
public const int DefaultOrder = -1;
public Filter(object instance, FilterScope scope, int? order) {
if (instance == null) {
throw new ArgumentNullException("instance");
}
if (order == null) {
IMvcFilter mvcFilter = instance as IMvcFilter;
if (mvcFilter != null) {
order = mvcFilter.Order;
}
}
Instance = instance;
Order = order ?? DefaultOrder;
Scope = scope;
}
public object Instance {
get;
protected set;
}
public int Order {
get;
protected set;
}
public FilterScope Scope {
get;
protected set;
}
}
}
|