System.Web.Routing.Route.ProcessConstraint C# (CSharp) Method

ProcessConstraint() protected method

protected ProcessConstraint ( System.Web.HttpContextBase httpContext, object constraint, string parameterName, RouteValueDictionary values, RouteDirection routeDirection ) : bool
httpContext System.Web.HttpContextBase
constraint object
parameterName string
values RouteValueDictionary
routeDirection RouteDirection
return bool
		protected virtual bool ProcessConstraint (HttpContextBase httpContext, object constraint, string parameterName, RouteValueDictionary values, RouteDirection routeDirection)
		{
			if (parameterName == null)
				throw new ArgumentNullException ("parameterName");

			// .NET "compatibility"
			if (values == null)
				throw new NullReferenceException ();
			
			bool invalidConstraint;
			bool ret = ProcessConstraintInternal (httpContext, this, constraint, parameterName, values, routeDirection, out invalidConstraint);
			
			if (invalidConstraint)
				throw new InvalidOperationException (
					String.Format (
						"Constraint parameter '{0}' on the route with URL '{1}' must have a string value type or be a type which implements IRouteConstraint",
						parameterName, Url
					)
				);

			return ret;
		}
	}