You've already forked linux-packaging-mono
Imported Upstream version 4.0.0~alpha1
Former-commit-id: 806294f5ded97629b74c85c09952f2a74fe182d9
This commit is contained in:
62
external/referencesource/System.Web/Routing/RouteData.cs
vendored
Normal file
62
external/referencesource/System.Web/Routing/RouteData.cs
vendored
Normal file
@ -0,0 +1,62 @@
|
||||
namespace System.Web.Routing {
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
[TypeForwardedFrom("System.Web.Routing, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
|
||||
public class RouteData {
|
||||
private IRouteHandler _routeHandler;
|
||||
private RouteValueDictionary _values = new RouteValueDictionary();
|
||||
private RouteValueDictionary _dataTokens = new RouteValueDictionary();
|
||||
|
||||
public RouteData() {
|
||||
}
|
||||
|
||||
public RouteData(RouteBase route, IRouteHandler routeHandler) {
|
||||
Route = route;
|
||||
RouteHandler = routeHandler;
|
||||
}
|
||||
|
||||
public RouteValueDictionary DataTokens {
|
||||
get {
|
||||
return _dataTokens;
|
||||
}
|
||||
}
|
||||
|
||||
public RouteBase Route {
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public IRouteHandler RouteHandler {
|
||||
get {
|
||||
return _routeHandler;
|
||||
}
|
||||
set {
|
||||
_routeHandler = value;
|
||||
}
|
||||
}
|
||||
|
||||
public RouteValueDictionary Values {
|
||||
get {
|
||||
return _values;
|
||||
}
|
||||
}
|
||||
|
||||
public string GetRequiredString(string valueName) {
|
||||
object value;
|
||||
if (Values.TryGetValue(valueName, out value)) {
|
||||
string valueString = value as string;
|
||||
if (!String.IsNullOrEmpty(valueString)) {
|
||||
return valueString;
|
||||
}
|
||||
}
|
||||
throw new InvalidOperationException(
|
||||
String.Format(
|
||||
CultureInfo.CurrentUICulture,
|
||||
SR.GetString(SR.RouteData_RequiredValue),
|
||||
valueName));
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user