Encapsulates the resolution of routes configuration: the RouteConfiguration.Resolve method computes it.
Exemplo n.º 1
0
        /// <summary>
        /// Attempts to resolve the configuration. Null if an error occurred.
        /// </summary>
        /// <param name="monitor">Monitor to use. Must not be null.</param>
        /// <returns>Null or a set of resolved route configuration.</returns>
        public RouteConfigurationResult Resolve(IActivityMonitor monitor)
        {
            if (monitor == null)
            {
                throw new ArgumentNullException("monitor");
            }
            RouteConfigurationResult result;
            bool hasError = false;

            using (monitor.OnError(() => hasError = true))
            {
                var r = new RouteResolver(monitor, this);
                result = new RouteConfigurationResult(r.Root, r.NamedSubRoutes);
            }
            return(hasError ? null : result);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Attempts to resolve the configuration. Null if an error occurred.
 /// </summary>
 /// <param name="monitor">Monitor to use. Must not be null.</param>
 /// <returns>Null or a set of resolved route configuration.</returns>
 public RouteConfigurationResult Resolve( IActivityMonitor monitor )
 {
     if( monitor == null ) throw new ArgumentNullException( "monitor" );
     RouteConfigurationResult result;
     bool hasError = false;
     using( monitor.OnError( () => hasError = true ) )
     {
         var r = new RouteResolver( monitor, this );
         result = new RouteConfigurationResult( r.Root, r.NamedSubRoutes );
     }
     return hasError ? null : result;
 }