本文整理汇总了C#中Route.AddParameter方法的典型用法代码示例。如果您正苦于以下问题:C# Route.AddParameter方法的具体用法?C# Route.AddParameter怎么用?C# Route.AddParameter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Route
的用法示例。
在下文中一共展示了Route.AddParameter方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateRoute
static Route CreateRoute(DependencyObject d)
{
var routeString = GetRoute(d);
var action = routeString.Split(' ')[0];
var resource = routeString.Split(' ')[1];
var route = new Route(action, resource);
var view = ViewProperties.GetView(d);
route.AddParameter(KnownParameters.ParentView, view);
var showAs = ViewProperties.GetShowAs(d);
route.AddParameter(KnownParameters.ParentShowAs, showAs);
var parameters = GetParams(d);
if (parameters != null)
{
foreach (var p in parameters)
{
var element = d as FrameworkElement;
p.DataContext = element.DataContext;
route.AddParameter(p.Key, p.Value);
}
}
return route;
}
示例2: ViewRouteResult
public ViewRouteResult(IRoute route, object view, string showAs)
{
var result = route as IRouteResult ?? new RouteResult(route);
CopyFrom(result);
AddHistory(route);
var nextRoute = new Route(route);
nextRoute.AddParameter(KnownParameters.View, view);
if (nextRoute.DoesNotContain(KnownParameters.ShowAs))
nextRoute.AddParameter(KnownParameters.ShowAs, showAs);
Next(nextRoute);
}
示例3: ViewModelRouteResult
public ViewModelRouteResult(IRoute route, object viewModel)
{
var result = route as IRouteResult ?? new RouteResult(route);
CopyFrom(result);
AddHistory(route);
var nextRoute = new Route(route);
nextRoute.AddParameter("ViewModel", viewModel);
Next(nextRoute);
}
示例4: ControllerRouteResult
public ControllerRouteResult(IRoute route, object controller)
{
var result = route as IRouteResult ?? new RouteResult(route);
CopyFrom(result);
AddHistory(route);
var nextRoute = new Route(route);
nextRoute.AddParameter(KnownParameters.Controller, controller);
Next(nextRoute);
}
示例5: Process
public IRouteResult Process(IRoute route)
{
var showAs = route.Parameters[KnownParameters.ParentShowAs].ToString();
var view = route.Parameters[KnownParameters.ParentView];
var next = new Route("close", showAs);
next.AddParameter(KnownParameters.View, view);
var result = new RouteResult(route);
result.Next(next);
return result;
}
示例6: Process
public IRouteResult Process(IRoute route)
{
var result = new RouteResult(route);
var next = new Route("show", "errors")
.CopyParameterFrom(route, KnownParameters.Errors);
var view = route.Parameters[KnownParameters.ParentView];
next.AddParameter(KnownParameters.View, view);
result.Next(next);
return result;
}
示例7: ToRoute
public static IRoute ToRoute(this string s)
{
var words = s.Split(' ');
var action = words[0];
var resource = words[1];
var route = new Route(action, resource);
var parameters = words.Skip(2);
foreach(var parameterString in parameters)
{
var key = parameterString.Split(':')[0];
var value = parameterString.Split(':')[1];
value = value.Replace("\'", "");
route.AddParameter(key, value);
}
return route;
}