• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Models.Page类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Kooboo.CMS.Sites.Models.Page的典型用法代码示例。如果您正苦于以下问题:C# Page类的具体用法?C# Page怎么用?C# Page使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Page类属于Kooboo.CMS.Sites.Models命名空间,在下文中一共展示了Page类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: ExecuteResult

        public override void ExecuteResult(ControllerContext context)
        {
            string siteName = context.HttpContext.Request.QueryString["cms_siteName"];
            string pageName = context.HttpContext.Request.QueryString["cms_pageName"];

            if (string.IsNullOrEmpty(siteName) || string.IsNullOrEmpty(pageName))
            {
                context.HttpContext.Response.StatusCode = 404;
                return;
            }
            var site = new Site(siteName).AsActual();
            if (site == null)
            {
                context.HttpContext.Response.StatusCode = 404;
                return;
            }
            var page = new Page(site, pageName).AsActual();
            if (page == null || page.PagePositions == null)
            {
                context.HttpContext.Response.StatusCode = 404;
                return;
            }
            var proxyPosition = page.PagePositions.OfType<ProxyPosition>().FirstOrDefault();
            if (proxyPosition == null)
            {
                context.HttpContext.Response.StatusCode = 404;
                return;
            }
            var remoteUrl = context.HttpContext.Request.RawUrl;
            var content = _proxyRender.Render(new ProxyRenderContext(context, null, proxyPosition, remoteUrl));
            if (content != null && !string.IsNullOrEmpty(content.ToString()))
            {
                context.HttpContext.Response.Write(content.ToString());
            }
        }
开发者ID:Godoy,项目名称:CMS,代码行数:35,代码来源:RemoteRequestActionResult.cs


示例2: PageMenuItem

        public PageMenuItem(Page page)
        {
            base.Action = "Index";
            base.Controller = "Page";
            base.Area = "Sites";
            base.Text = page.Name;
            if (page.Navigation != null && !string.IsNullOrEmpty(page.Navigation.DisplayText))
            {
                base.Text = page.Navigation.DisplayText;
            }
            base.Tips = page.Name;

            base.Visible = true;
            RouteValues = new System.Web.Routing.RouteValueDictionary();
            RouteValues.Add("parentPage", page.FullName);

            HtmlAttributes = new System.Web.Routing.RouteValueDictionary();
            if (page.IsDefault)
            {
                HtmlAttributes.Add("class", "home");
            }

            //this.Page = page;
            Initializer = new PageMenuItemInitializer();
        }
开发者ID:night-king,项目名称:CMS,代码行数:25,代码来源:PageMenuItems.cs


示例3: GetModulePositionIdForUrl

        public string GetModulePositionIdForUrl(ModulePosition modulePosition, RouteValueDictionary routeValues, out Page page)
        {
            page = this.PageRequestContext.Page;
            string modulePositionId = modulePosition.PagePositionId;

            if (!string.IsNullOrEmpty(modulePosition.Entry.LinkToEntryName))
            {
                foreach (var item in Kooboo.CMS.Sites.Services.ServiceFactory.PageManager.All(this.PageRequestContext.Site, null))
                {
                    foreach (var position in item.PagePositions.OfType<ModulePosition>())
                    {
                        if (position.Entry != null && !string.IsNullOrEmpty(position.Entry.Name)
                            && position.Entry.Name.EqualsOrNullEmpty(modulePosition.Entry.LinkToEntryName, StringComparison.OrdinalIgnoreCase))
                        {
                            page = item;
                            modulePositionId = position.PagePositionId;
                        }
                    }
                }
            }
            else
            {
                modulePositionId = GetModulePositionIdForUrl(modulePosition.ModuleName, modulePosition.PagePositionId, routeValues);
            }

            return modulePositionId;
        }
开发者ID:ZhiGuangHuang,项目名称:CMS,代码行数:27,代码来源:PageRequestContext.cs


示例4: AddCaching

 public virtual void AddCaching(HttpContextBase httpContext, Page page, string html)
 {
     var filePath = GetFilePath(page, httpContext.Request.Path);
     if (!File.Exists(filePath))
     {
         IOUtility.SaveStringToFile(filePath, html);
     }
 }
开发者ID:kooboo-jifeng,项目名称:CMS,代码行数:8,代码来源:PageCachingManager.cs


示例5: GetAbsolutePageUrl

 public static string GetAbsolutePageUrl(Site site, Page page, object values)
 {
     UrlHelper urlHelper = MvcUtility.GetUrlHelper();
     FrontRequestChannel requestChannel = site.FrontRequestChannel();
     string pageUrl = FrontUrlHelper.GeneratePageUrl(urlHelper, site, page, values, requestChannel).ToString();
     string host = GetHost(site);
     return HttpContext.Current.Request.ToAbsoluteUrl(host, pageUrl);
 }
开发者ID:Qupy,项目名称:Extensions,代码行数:8,代码来源:PageUtility.cs


示例6: 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


示例7: GetPageItems

 private void GetPageItems(Page page, List<SelectListItem> items)
 {
     items.Add(new SelectListItem() { Text = page.FriendlyName, Value = page.FriendlyName });
     foreach (var child in Kooboo.CMS.Sites.Persistence.Providers.PageProvider.ChildPages(page))
     {
         GetPageItems(child, items);
     }
 }
开发者ID:Epitomy,项目名称:CMS,代码行数:8,代码来源:UrlKeyMap_Metadata.cs


示例8: GetFilePath

 protected virtual string GetFilePath(Page page, string requestPath)
 {
     requestPath = requestPath.TrimEnd('/');
     var extension = Path.GetExtension(requestPath);
     if (string.IsNullOrEmpty(extension))
     {
         requestPath = requestPath + "/default.html";
     }
     return Path.Combine(GetPageCachingPath(page), requestPath.TrimStart('/'));
 }
开发者ID:kooboo-jifeng,项目名称:CMS,代码行数:10,代码来源:PageCachingManager.cs


示例9: EnsurePagePublished

 protected virtual void EnsurePagePublished(Controller controller, Page page)
 {
     if (page.Published.Value == false)
     {
         if (!HttpContext.Current.User.Identity.IsAuthenticated)
         {
             throw new HttpException(0x194, string.Format(SR.GetString("Path_not_found"), new object[] { controller.Request.Path }));
         }
     }
 }
开发者ID:jason1234,项目名称:CMS,代码行数:10,代码来源:PageExecutionFilterAttribute.cs


示例10: GetCaching

 public virtual string GetCaching(HttpContextBase httpContext, Page page)
 {
     string html = null;
     var filePath = GetFilePath(page, httpContext.Request.Path);
     if (File.Exists(filePath))
     {
         html = IOUtility.ReadAsString(filePath);
     }
     return html;
 }
开发者ID:kooboo-jifeng,项目名称:CMS,代码行数:10,代码来源:PageCachingManager.cs


示例11: TestPhysicalPath

        public void TestPhysicalPath()
        {
            string pageName = "page1";
            var site = new Site("Site1");
            var page = new Page(site, new string[] { pageName });

            string expected1 = Path.Combine(site.PhysicalPath, "pages", pageName);

            Assert.AreEqual(expected1, page.PhysicalPath, true);
        }
开发者ID:Godoy,项目名称:CMS,代码行数:10,代码来源:PageTests.cs


示例12: TestParseFromPhysicalPath

        public void TestParseFromPhysicalPath()
        {
            string siteName = "site1";
            string pageName = "page1";
            string physicalPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "sites", siteName, "pages", pageName);

            var page = new Page(physicalPath);

            Assert.AreEqual(pageName, page.Name);
            Assert.IsTrue(page.IsDummy);
        }
开发者ID:Godoy,项目名称:CMS,代码行数:11,代码来源:PageTests.cs


示例13: GenerateList

        private void GenerateList(Site site, Page page, ref IEnumerable<Page> pageList)
        {
            var children = Kooboo.CMS.Sites.Services.ServiceFactory.PageManager.ChildPages(site, page.FullName, null);

            pageList = pageList.Concat(children);

            foreach (var s in children)
            {
                this.GenerateList(site, s, ref pageList);
            }
        }
开发者ID:Epitomy,项目名称:CMS,代码行数:11,代码来源:CustomError_Metadata.cs


示例14: UpdatePage

        public string UpdatePage(string repositoryId, string pageId, Page properties)
        {
            var site = ModelHelper.GetSite(repositoryId);

            var page = new Page(site, pageId);

            MapProperties(properties, page);

            _incomeDataManager.UpdatePage(site, page, ContextHelper.GetVendor());

            return page.FullName;
        }
开发者ID:Godoy,项目名称:CMS,代码行数:12,代码来源:PageService.cs


示例15: TestChildVirtualPath

        public void TestChildVirtualPath()
        {
            string parentPageName = "page1";
            var site = new Site("Site1");
            var parent = new Page(site, new string[] { parentPageName });
            string childPageName = "childPage";
            var child = new Page(parent, childPageName);

            string expected1 = "page1/childPage";// Kooboo.Web.Url.UrlUtility.Combine(site.VirtualPath, "pages", parentPageName, childPageName);

            Assert.AreEqual(expected1, child.VirtualPath, true);
        }
开发者ID:Epitomy,项目名称:CMS,代码行数:12,代码来源:PageTests.cs


示例16: TestChildPhysicalPath

        public void TestChildPhysicalPath()
        {
            string parentPageName = "page1";
            var site = new Site("Site1");
            var parent = new Page(site, new string[] { parentPageName });
            string childPageName = "childPage";
            var child = new Page(parent, childPageName);

            string expected1 = Path.Combine(site.PhysicalPath, "pages", parentPageName, childPageName);

            Assert.AreEqual(expected1, child.PhysicalPath, true);
        }
开发者ID:Godoy,项目名称:CMS,代码行数:12,代码来源:PageTests.cs


示例17: Copy

        public static Page Copy(this Page page)
        {
            //var tempPage = CloneUtility.DeepClone(page);
            var tempPage = new Page();
            tempPage.Name = page.Name;
            tempPage.FullName = page.FullName;
            tempPage.ContentTitle = page.ContentTitle;

            tempPage.Layout = page.Layout;
            tempPage.PagePositions = page.PagePositions;
            tempPage.EnableTheming = page.EnableTheming;
            tempPage.EnableScript = page.EnableScript;
            tempPage.Searchable = page.Searchable;
            tempPage.OutputCache = page.OutputCache;
            tempPage.PageType = page.PageType;
            tempPage.IsDefault = page.IsDefault;
            tempPage.IsDummy = page.IsDummy;

            tempPage.Navigation = new Navigation();
            tempPage.Navigation.Show = page.Navigation.Show;
            tempPage.Navigation.DisplayText = page.Navigation.DisplayText;
            tempPage.Navigation.Order = page.Navigation.Order;
            tempPage.Navigation.ShowInCrumb = page.Navigation.ShowInCrumb;

            tempPage.HtmlMeta = page.HtmlMeta;
            //tempPage.Route = page.Route;
            tempPage.Route = new PageRoute();
            tempPage.Route.ExternalUrl = page.Route.ExternalUrl;
            tempPage.Route.Identifier = page.Route.Identifier;
            tempPage.Route.RoutePath = page.Route.RoutePath;
            tempPage.Route.Defaults = page.Route.Defaults;

            tempPage.DataRules = page.DataRules;
            tempPage.Plugins = page.Plugins;
            //tempPage.CustomFields = page.CustomFields;
            tempPage.CustomFields = new Dictionary<string, string>();
            if(page.CustomFields != null)
            {
                foreach(var customField in page.CustomFields)
                {
                    tempPage.CustomFields.Add(customField.Key, customField.Value);
                }
            }

            tempPage.Published = page.Published;
            tempPage.Site = page.Site;
            tempPage.Parent = page.Parent;
            tempPage.Permission = page.Permission;
            tempPage.UserName = page.UserName;

            return tempPage;
        }
开发者ID:Qupy,项目名称:Extensions,代码行数:52,代码来源:PageExtensions.cs


示例18: CreateSelectItemTreeNode

        protected virtual void CreateSelectItemTreeNode(RequestContext requestContext, Page page, List<SelectListItem> list)
        {
            var item = new SelectListItem();
            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:Godoy,项目名称:CMS,代码行数:14,代码来源:PagesDataSource.cs


示例19: Sibling

 public static IEnumerable<Page> Sibling(Page page)
 {
     if (page.Parent == null)
     {
         return Top();
     }
     else
     {
         return ServiceFactory.PageManager.ChildPages(Site.Current, page.Parent.FullName, "")
             .Select(it => it.AsActual())
             .Where(it => it.Navigation.Show)
             .Where(it => it.Published.HasValue && it.Published.Value == true)
             .OrderBy(it => it.Navigation.Order);
     }
 }
开发者ID:Epitomy,项目名称:CMS,代码行数:15,代码来源:MenuHelper.cs


示例20: Discard

        public ActionResult Discard(string uuid, string @return)
        {
            ModelState.Clear();
            var data = new JsonResultData(ModelState);
            data.RunWithTry((resultData) =>
            {
                var page = new Page(Site, uuid);

                _pageManager.Provider.RemoveDraft(page);

                data.RedirectUrl = @return;
            });

            return Json(data);
        }
开发者ID:Godoy,项目名称:CMS,代码行数:15,代码来源:PageDraftController.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Models.Site类代码示例发布时间:2022-05-26
下一篇:
C# Models.TextFolder类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap