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


C# RequestContext.GetRequestValue方法代码示例

本文整理汇总了C#中System.Web.Routing.RequestContext.GetRequestValue方法的典型用法代码示例。如果您正苦于以下问题:C# RequestContext.GetRequestValue方法的具体用法?C# RequestContext.GetRequestValue怎么用?C# RequestContext.GetRequestValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Web.Routing.RequestContext的用法示例。


在下文中一共展示了RequestContext.GetRequestValue方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: MatchProvider

        private static bool MatchProvider(MvcRoute applyTo, RequestContext requestContext)
        {
            var area = AreaHelpers.GetAreaName(requestContext.RouteData);
            var controller = requestContext.GetRequestValue("controller");
            var action = requestContext.GetRequestValue("action");

            var matched = applyTo.Area.EqualsOrNullEmpty(area, StringComparison.OrdinalIgnoreCase)
                 && applyTo.Controller.Equals(controller, StringComparison.OrdinalIgnoreCase)
                 && applyTo.Action.EqualsOrNullEmpty(action, StringComparison.OrdinalIgnoreCase);

            if (matched && applyTo.RouteValues != null)
            {
                foreach (var item in applyTo.RouteValues)
                {
                    if (item.Value == null)
                    {
                        continue;
                    }
                    var routeValue = requestContext.GetRequestValue(item.Key);
                    if (routeValue == null)
                    {
                        matched = false;
                        break;
                    }
                    if (!item.Value.ToString().EqualsOrNullEmpty(routeValue.ToString(), StringComparison.OrdinalIgnoreCase))
                    {
                        matched = false;
                        break;
                    }
                }
            }

            return matched;
        }
开发者ID:night-king,项目名称:CMS,代码行数:34,代码来源:ToolbarButtons.cs

示例2: GetSelectListItems

 public IEnumerable<SelectListItem> GetSelectListItems(RequestContext requestContext, string filter)
 {
     var siteName = requestContext.GetRequestValue("siteName");
     if (string.IsNullOrEmpty(siteName))
     {
         siteName = requestContext.GetRequestValue("parent");
     }
     if (!string.IsNullOrEmpty(siteName))
     {
         var site = new Site(siteName);
         foreach (var item in ThemeFileManager.AllThemes(site))
         {
             yield return new SelectListItem() { Text = item, Value = item };
         }
     }
 }
开发者ID:Godoy,项目名称:CMS,代码行数:16,代码来源:ThemesDataSource.cs

示例3: CreateSelectItemTreeNode

 protected override void CreateSelectItemTreeNode(RequestContext requestContext, Page page, List<System.Web.Mvc.SelectListItem> list)
 {
     string uuid = requestContext.GetRequestValue("UUID");
     if (uuid.ToLower() != page.UUID.ToLower())
     {
         base.CreateSelectItemTreeNode(requestContext,page, list);
     }
 }
开发者ID:Godoy,项目名称:CMS,代码行数:8,代码来源:CopyPageDataSource.cs

示例4: GetSite

 private static Site GetSite(RequestContext requestContext)
 {
     var siteName = requestContext.GetRequestValue("siteName");
     if (!string.IsNullOrEmpty(siteName))
     {
         return SiteHelper.Parse(siteName);
     }
     return null;
 }
开发者ID:Godoy,项目名称:CMS,代码行数:9,代码来源:AuthorizationHelpers.cs

示例5: GetSelectListItems

 public IEnumerable<System.Web.Mvc.SelectListItem> GetSelectListItems(RequestContext requestContext, string filter)
 {
     var site = new Site(requestContext.GetRequestValue("siteName"));
     var categories = Kooboo.CMS.Sites.Services.ServiceFactory.LabelManager.GetCategories(site).Where(it => !string.IsNullOrEmpty(it.Category));
     if (!string.IsNullOrEmpty(filter))
     {
         categories = categories.Where(it => it.Category.StartsWith(filter, StringComparison.CurrentCultureIgnoreCase));
     }
     return categories.Select(it => new SelectListItem() { Text = it.Category, Value = it.Category });
 }
开发者ID:Godoy,项目名称:CMS,代码行数:10,代码来源:ElementCategoryCulturesSelectListDataSource.cs

示例6: GetSelectListItems

        public IEnumerable<System.Web.Mvc.SelectListItem> GetSelectListItems(RequestContext requestContext, string filter)
        {
            var site = Site.Current;

            var fullName = requestContext.GetRequestValue("fullName");
            var page = Kooboo.CMS.Sites.Services.ServiceFactory.PageManager.Get(site, fullName);
            Layout layout = Kooboo.CMS.Sites.Services.ServiceFactory.LayoutManager.Get(site, page.Layout);

            var positionList = layout.Positions;
            foreach (var position in positionList)
            {
                yield return new System.Web.Mvc.SelectListItem() { Value = position.ID, Text = position.ID };
            }
        }
开发者ID:Epitomy,项目名称:CMS,代码行数:14,代码来源:PagePosition_Metadata.cs

示例7: CreateSelectItemTreeNode

        protected override void CreateSelectItemTreeNode(RequestContext requestContext, Page page, List<System.Web.Mvc.SelectListItem> list)
        {
            string uuid = requestContext.GetRequestValue("UUID");
            var sourcePage = new Page(page.Site, uuid);

            var item = new SelectListItem();

            if (sourcePage != page && sourcePage.Parent != page)
            {
                item.Text = page.FriendlyName;
                item.Value = page.FullName;
                list.Add(item);
            }

            var children = ServiceFactory.PageManager.ChildPages(Site.Current, page.FullName, null);

            children.ForEach((p, index) =>
            {
                CreateSelectItemTreeNode(requestContext, p, list);
            });
        }
开发者ID:night-king,项目名称:CMS,代码行数:21,代码来源:MovePageDataSource.cs

示例8: GetSite

 private Site GetSite(RequestContext requestContext)
 {
     var siteName = requestContext.GetRequestValue("siteName");
     if (!string.IsNullOrEmpty(siteName))
     {
         var site = new Site(siteName).AsActual();
         return site;
     }
     return null;
 }
开发者ID:night-king,项目名称:CMS,代码行数:10,代码来源:SiteCustomTabProvider.cs

示例9: GetPage

 private Page GetPage(Site site, RequestContext requestContext)
 {
     var pageName = requestContext.GetRequestValue("UUID");
     if (!string.IsNullOrEmpty(pageName))
     {
         var page = new Page(site, pageName).AsActual();
         return page;
     }
     return null;
 }
开发者ID:Godoy,项目名称:CMS,代码行数:10,代码来源:PageCustomTabProvider.cs

示例10: CreateItem

        private static SelectListItemTree CreateItem(SiteNode siteNode, RequestContext requestContext)
        {
            if (siteNode == null)
            {
                return new SelectListItemTree();
            }

            var selectListItem = new SelectListItemTree();

            var site = Kooboo.CMS.Sites.Models.IPersistableExtensions.AsActual(siteNode.Site);
            selectListItem.Text = string.IsNullOrEmpty(site.DisplayName) ? site.Name : site.DisplayName;
            selectListItem.Value = site.FullName;

            string parent = requestContext.GetRequestValue("parent");

            selectListItem.Selected = site.FullName.EqualsOrNullEmpty(parent, StringComparison.CurrentCultureIgnoreCase);

            var children = siteNode.Children;
            var items = new List<SelectListItemTree>();
            foreach (var c in children)
            {
                items.Add(CreateItem(c, requestContext));
            }
            selectListItem.Items = items;
            return selectListItem;
        }
开发者ID:Epitomy,项目名称:CMS,代码行数:26,代码来源:Site_Metadata.cs

示例11: GetSelectListItems

 public IEnumerable<SelectListItem> GetSelectListItems(RequestContext requestContext, string filter)
 {
     var siteName = requestContext.GetRequestValue("siteName");
     if (string.IsNullOrEmpty(siteName))
     {
         siteName = requestContext.GetRequestValue("parent");
     }
     if (!string.IsNullOrEmpty(siteName))
     {
         var site = SiteHelper.Parse(siteName);
         foreach (var item in ServiceFactory.ThemeManager.All(site, ""))
         {
             yield return new SelectListItem() { Text = item.Name, Value = item.Name };
         }
     }
 }
开发者ID:Epitomy,项目名称:CMS,代码行数:16,代码来源:Site_Metadata.cs


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