当前位置: 首页>>代码示例>>C#>>正文


C# Route.AddParameter方法代码示例

本文整理汇总了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;
        }
开发者ID:RookieOne,项目名称:Chimera,代码行数:28,代码来源:RouteBehavior.cs

示例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);
        }
开发者ID:RookieOne,项目名称:Chimera,代码行数:15,代码来源:ViewRouteResult.cs

示例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);
        }
开发者ID:RookieOne,项目名称:Chimera,代码行数:12,代码来源:ViewModelRouteResult.cs

示例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);
        }
开发者ID:RookieOne,项目名称:Chimera,代码行数:12,代码来源:ControllerRouteResult.cs

示例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;
        }
开发者ID:RookieOne,项目名称:Chimera,代码行数:13,代码来源:OnSuccessClose.cs

示例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;
        }
开发者ID:RookieOne,项目名称:Chimera,代码行数:14,代码来源:ErrorProcessor.cs

示例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;
        }
开发者ID:RookieOne,项目名称:Chimera,代码行数:22,代码来源:RouteStringExtensions.cs


注:本文中的Route.AddParameter方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。