Exemplo n.º 1
0
        }         // End Sub InitializeHashSet

        bool Microsoft.AspNetCore.Routing.IRouteConstraint.Match(
            Microsoft.AspNetCore.Http.HttpContext httpContext
            , Microsoft.AspNetCore.Routing.IRouter route
            , string routeKey
            , Microsoft.AspNetCore.Routing.RouteValueDictionary values
            , Microsoft.AspNetCore.Routing.RouteDirection routeDirection)
        {
            if (routeDirection != Microsoft.AspNetCore.Routing.RouteDirection.IncomingRequest)
            {
                return(false);
            }

            if (s_tables == null)
            {
                InitializeHashSet(httpContext.RequestServices);
            } // End if (s_tables == null)

            // object value = values[routeKey];

            object value;

            if (values.TryGetValue(routeKey, out value) && value != null)
            {
                return(s_tables.Contains(value.ToString()));
            }

            return(false);
        } // End Function IRouteConstraint.Match
Exemplo n.º 2
0
 bool Microsoft.AspNetCore.Routing.IRouteConstraint.Match(
     Microsoft.AspNetCore.Http.HttpContext httpContext
     , Microsoft.AspNetCore.Routing.IRouter route
     , string routeKey
     , Microsoft.AspNetCore.Routing.RouteValueDictionary values
     , Microsoft.AspNetCore.Routing.RouteDirection routeDirection)
 {
     throw new System.NotImplementedException();
 } // End Function Match
Exemplo n.º 3
0
        bool Microsoft.AspNetCore.Routing.IRouteConstraint.Match(
            Microsoft.AspNetCore.Http.HttpContext httpContext
            , Microsoft.AspNetCore.Routing.IRouter route
            , string routeKey
            , Microsoft.AspNetCore.Routing.RouteValueDictionary values
            , Microsoft.AspNetCore.Routing.RouteDirection routeDirection)
        {
            // You can also try Enum.IsDefined,
            // but docs say nothing as to if it is case sensitive or not.

            string[] colors = System.Enum.GetNames(typeof(System.Drawing.KnownColor));
            string   key    = System.Convert.ToString(values[routeKey]);

            foreach (string thisColor in colors)
            {
                if (System.StringComparer.InvariantCultureIgnoreCase.Equals(
                        thisColor, key))
                {
                    return(true);
                }
            } // Next thisColor

            return(false);
        } // End Function IRouteConstraint.Match