// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Collections.Generic; using System.Text; namespace Microsoft.AspNet.Routing.Logging { /// /// Describes the state of /// . /// public class TemplateRouteRouteAsyncValues { /// /// The name of the state. /// public string Name { get { return "TemplateRoute.RouteAsync"; } } /// /// The target. /// public IRouter Target { get; set; } /// /// The template. /// public string Template { get; set; } /// /// The request path. /// public string RequestPath { get; set; } /// /// The values produced by default. /// public IReadOnlyDictionary DefaultValues { get; set; } /// /// The values produced from the request. /// public IDictionary ProducedValues { get; set; } /// /// The constraints matched on the produced values. /// public IReadOnlyDictionary Constraints { get; set; } /// /// True if the matched. /// public bool MatchedTemplate { get; set; } /// /// True if the matched. /// public bool MatchedConstraints { get; set; } /// /// True if this route matched. /// public bool Matched { get; set; } /// /// True if the request is handled. /// public bool Handled { get; set; } /// /// A summary of the data for display. /// public string Summary { get { var builder = new StringBuilder(); builder.AppendLine(Name); builder.Append("\tTarget: "); builder.Append(Target); builder.AppendLine(); builder.Append("\tTemplate: "); builder.AppendLine(Template); builder.Append("\tRequest path: "); builder.AppendLine(RequestPath); builder.Append("\tDefault values: "); StringBuilderHelpers.Append(builder, DefaultValues); builder.AppendLine(); builder.Append("\tProduced values: "); StringBuilderHelpers.Append(builder, ProducedValues); builder.AppendLine(); builder.Append("\tConstraints: "); StringBuilderHelpers.Append(builder, Constraints); builder.AppendLine(); builder.Append("\tMatched template? "); builder.Append(MatchedTemplate); builder.AppendLine(); builder.Append("\tMatched constraints? "); builder.Append(MatchedConstraints); builder.AppendLine(); builder.Append("\tMatched? "); builder.Append(Matched); builder.AppendLine(); builder.Append("\tHandled? "); builder.Append(Handled); return builder.ToString(); } } /// public override string ToString() { return Summary; } } }