You've already forked linux-packaging-mono
Imported Upstream version 4.6.0.125
Former-commit-id: a2155e9bd80020e49e72e86c44da02a8ac0e57a4
This commit is contained in:
parent
a569aebcfd
commit
e79aa3c0ed
62
mcs/class/referencesource/System.Web/Routing/RouteData.cs
Normal file
62
mcs/class/referencesource/System.Web/Routing/RouteData.cs
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