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


C# System.PageData类代码示例

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


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

示例1: GenerateBreabCrumbs

        /// <summary>
        /// Creates the bread crumb link string from the start page of the site to the supplied page
        /// </summary>
        /// <param name="page">The last page in the bread crumb string.</param>
        /// <returns>A bread crumb string with anchors to parent pages.</returns>
        private string GenerateBreabCrumbs(PageData page)
        {
            // Initiate a string builder based on max length. The generated html is considerably longer than the visible text.
            StringBuilder breadCrumbsText = new StringBuilder(8 * MaxLength);

            // Initiate a counter holding the visible length of the bread crumbs with the length of the start page link text.
            int breadCrumbsLength = Translate("/navigation/startpage").Length;

            while (page != null && page.PageLink != PageReference.StartPage)
            {
                breadCrumbsLength += page.PageName.Length + Separator.Length;
                if (breadCrumbsLength > MaxLength)
                {
                    breadCrumbsText.Insert(0, Separator + "...");
                    break;
                }

                // Insert the link at beginning of the bread crumbs string
                breadCrumbsText.Insert(0, Separator + GetLink(page));

                // Get next visible parent
                page = GetParentPageData(page);
            }

            // Generate the start page link
            string startPageLinkUrl = Server.UrlPathEncode(GetPage(PageReference.StartPage).LinkURL);
            string startPageLink = String.Format(_link, startPageLinkUrl, Translate("/navigation/startpagelinktitle"), Translate("/navigation/startpage"));

            // Insert the startpage link and return
            return breadCrumbsText.Insert(0, startPageLink).ToString();
        }
开发者ID:sfdnug,项目名称:PublicSite,代码行数:36,代码来源:breadcrumbs.ascx.cs

示例2: BuildPageTemplate

        protected virtual void BuildPageTemplate(PageData pageData, string theme, RequestContext context,
            StringBuilder output, CursorCollection placeHolders,
            DirectiveCollection directives, List<IControlsContainer> controlConatiners)
        {
            controlConatiners.Add(pageData);

            if (!String.IsNullOrEmpty(pageData.MasterPage))
            {
                this.BuildWithMasterPage(pageData.MasterPage, context, output, placeHolders, directives);
                return;
            }

            if (!String.IsNullOrEmpty(pageData.ExternalPage))
            {
                this.BuildWithExternalPage(pageData.ExternalPage, context, output, placeHolders, directives);
                return;
            }

            if (this.BuildTemplateFromPresentationData(pageData.Presentation, theme, output, placeHolders, directives, context))
                return;

            if (pageData.Template != null)
            {
                BuildPageTemplateRecursive(pageData.Template, theme, context, output, placeHolders, directives, controlConatiners);
                return;
            }

            var defaultRootTemplate = new RootTemplate();
            defaultRootTemplate.FromString(ControlUtilities.GetSitefinityTextResource(Constants.DefaultFrontendPageTemplate));
            RootTemplate result = this.GetRootTemplate(defaultRootTemplate, context, theme);
            this.ProcessStringTemplate(result.Template, output, placeHolders, directives);
        }
开发者ID:mcupryk,项目名称:PowerTools,代码行数:32,代码来源:ExtendedWebFormsPageResolver.cs

示例3: GetPropertyTags

 private static IEnumerable<string> GetPropertyTags(PageData page, PropertyDefinition propertyDefinition)
 {
     var tagNames = page[propertyDefinition.Name] as string;
     return tagNames == null
         ? Enumerable.Empty<string>()
         : tagNames.Split(new[] {',', ' '}, StringSplitOptions.RemoveEmptyEntries);
 }
开发者ID:sebastianbrand,项目名称:Tags,代码行数:7,代码来源:TagsModule.cs

示例4: ShowInSiteMap

 private bool ShowInSiteMap(PageData page)
 {
     //// Might want to only expose project page types.
     //if(!(page is MyProjectPageBase))
     //{
     //    return false;
     //}
     if (!page.IsIndexablePageType())
     {
         return false;
     }
     if (!page.CheckPublishedStatus(PagePublishedStatus.Published))
     {
         return false;
     }
     if (!_filterAccessWrapper.QueryDistinctAccessEdit(page, AccessLevel.NoAccess))
     {
         return false;
     }
     //// Dynamic property: Checkbox for including/excluding page instance in sitemap.xml. For an overridable dynamic property checkbox
     //// wrapper, see https://blog.mathiaskunto.com/2015/02/09/custom-property-checkbox-wrapper-as-dynamic-property-in-episerver-7-5/
     //if (!(page as MyProjectPageBase).IncludeInSitemap)
     //{
     //    return false;
     //}
     return true;
 }
开发者ID:kirolosgerges,项目名称:Blog,代码行数:27,代码来源:PageTreeStrategy.cs

示例5: RoutePartial

        public override object RoutePartial(PageData content, SegmentContext segmentContext)
        {
            var routedContet = base.RoutePartial(content, segmentContext);

            var segmentPair = segmentContext.GetNextValue(segmentContext.RemainingPath);
            if (String.IsNullOrEmpty(segmentPair.Next))
            {
                return routedContet;
            }

            var facetNames = _facetUrlCreator.GetFacetModels().ToArray();

            var nextSegment = _facetUrlCreator.GetFacetValue(facetNames, segmentPair.Next);
            if (String.IsNullOrEmpty(nextSegment))
            {
                return routedContet;
            }

            var routeFacets = segmentContext.RouteData.Values[FacetUrlService.RouteFacets] as ConcurrentDictionary<RouteFacetModel, HashSet<object>>;
            if (routeFacets == null)
            {
                segmentContext.RouteData.Values[FacetUrlService.RouteFacets] = new ConcurrentDictionary<RouteFacetModel, HashSet<object>>();
                routeFacets = (ConcurrentDictionary<RouteFacetModel, HashSet<object>>)segmentContext.RouteData.Values[FacetUrlService.RouteFacets];
            }

            AddFacetsToSegmentContext(routeFacets, segmentContext, facetNames, nextSegment, segmentPair.Remaining, null);
            return routedContet;
        }
开发者ID:jonasbergqvist,项目名称:BrilliantCut.AutomaticLandingPage,代码行数:28,代码来源:FacetPartialRoute.cs

示例6: ConvertUrlToExternal

        public string ConvertUrlToExternal(PageData pageData = null, PageReference p = null)
        {
            if (pageData == null && p == null)
            {
                return string.Empty;
            }
            var page = pageData ?? _repository.Get<PageData>(p);

            var pageUrlBuilder = new UrlBuilder(page.LinkURL);

            Global.UrlRewriteProvider.ConvertToExternal(pageUrlBuilder, page.PageLink, Encoding.UTF8);

            string pageURL = pageUrlBuilder.ToString();

            UriBuilder uriBuilder = new UriBuilder(SiteDefinition.Current.SiteUrl);

            uriBuilder.Path = pageURL;
            var jj = ServiceLocator.Current.GetInstance<UrlResolver>().GetUrl(p);
            if (uriBuilder.Path == "/")
                return uriBuilder.Uri.AbsoluteUri;

            string[] words = uriBuilder.Uri.AbsoluteUri.Split(new char[] {':', '/', '.'},
                        StringSplitOptions.RemoveEmptyEntries);
            bool reoccurs = words.Count(q => q == "http") > 1;

            if (reoccurs)
                return uriBuilder.Uri.LocalPath.StartsWith("/") ? uriBuilder.Uri.LocalPath.Remove(0,1) : uriBuilder.Uri.LocalPath;

            return uriBuilder.Uri.AbsoluteUri;
        }
开发者ID:EpiCenterADC,项目名称:EPICenter,代码行数:30,代码来源:PageService.cs

示例7: AppendPage

 /// <summary>
 /// Appends the page.
 /// </summary>
 /// <param name="pageData">The page data.</param>
 /// <param name="json">The json.</param>
 private void AppendPage(PageData pageData, StringBuilder json)
 {
     json.Append(string.Format("{{\"w\":{0},\"h\":{1},\"number\":{2}",
         pageData.Width.ToString(_defaultCulture),
         pageData.Height.ToString(_defaultCulture),
         pageData.Number.ToString(_defaultCulture)));
 }
开发者ID:groupdocs-annotation,项目名称:groupdocs-annotation-net-sample,代码行数:12,代码来源:FileDataJsonSerializer.cs

示例8: EditAlbums

        public ActionResult EditAlbums(int page = 1)
        {
            string login = User.Identity.Name;
            var album = new PageData<string>(albumService.GetAllUserAlbumsNams(login), page);

            return View(album);
        }
开发者ID:BunjakMaxim,项目名称:BSU.ASP.15.01.Project,代码行数:7,代码来源:AlbumController.cs

示例9: GetFriendlyURL

        public static string GetFriendlyURL(PageData pageData)
        {
            UrlBuilder pageURLBuilder = new UrlBuilder(pageData.LinkURL);
            EPiServer.Global.UrlRewriteProvider.ConvertToExternal(pageURLBuilder, pageData.PageLink, UTF8Encoding.UTF8);

            return GetSiteRoot() + pageURLBuilder.Path;
        }
开发者ID:sandeepnp,项目名称:PugPigConnector,代码行数:7,代码来源:Common.cs

示例10: GetLanguageInfo

        public IEnumerable<ChromeLanguageInfo> GetLanguageInfo(PageData page)
        {
            List<ChromeLanguageInfo> languages = new List<ChromeLanguageInfo>();
            ReadOnlyStringList pageLanguages = page.PageLanguages;
            string currentLanguage = page.LanguageBranch;

            foreach (string language in pageLanguages)
            {
                LanguageBranch languageBranch = _languageBranchRepository.ListEnabled().FirstOrDefault(l => l.LanguageID.Equals(language, StringComparison.InvariantCultureIgnoreCase));
                if (languageBranch != null)
                {
                    languages.Add(new ChromeLanguageInfo()
                    {
                        DisplayName = languageBranch.Name,
                        IconUrl = languageBranch.ResolvedIconPath, //"/Content/Images/flags/" + language + ".png",
                        // We use this to enable language switching inside edit mode too
                        Url = languageBranch.CurrentUrlSegment,
                        EditUrl = PageEditing.GetEditUrlForLanguage(page.ContentLink, languageBranch.LanguageID),
                        Selected = string.Compare(language, currentLanguage, StringComparison.InvariantCultureIgnoreCase) == 0
                    });
                }
            }

            return languages;
        }
开发者ID:smchristenson,项目名称:CommerceStarterKit,代码行数:25,代码来源:PageContextActionFilter.cs

示例11: GetCurrentPagePreview

        /// <summary>
        /// Gets the currnt page's preview version
        /// </summary>
        /// <param name="pageManager">The page manager</param>
        /// <param name="pageName">The current page name</param>
        /// <returns>The current page preview</returns>
        public PageDraft GetCurrentPagePreview(PageManager pageManager, string pageName)
        {
            var homePage = new PageData();

            foreach (var f in pageManager.GetPageDataList())
            {
                if (f.NavigationNode.Title.GetString(f.NavigationNode.AvailableCultures[0], false).ToLower() == pageName.ToLower()
                                                    && !f.NavigationNode.IsDeleted
                                                    && f.NavigationNode.ParentId == new Guid(System.Web.SiteMap.RootNode.Key))
                {
                    homePage = f;
                    break;
                }
            }

            if (homePage == null)
                return null;

            var homePagePreview = pageManager.GetPreview(homePage.NavigationNode.PageId);

            if (homePagePreview == null)
                return null;

            if (homePagePreview.Controls[0].Properties.FirstOrDefault(r => r.Name == "Settings") == null)
                return null;

            return homePagePreview;
        }
开发者ID:Ian-Oliver,项目名称:testfinity,代码行数:34,代码来源:WidgetDesignerHelper.cs

示例12: GetMailInformation

        /// <summary>
        /// Populates needed mail information before sending. Will also check
        /// for Mailgun specific properties
        /// </summary>
        /// <remarks>
        /// Note! Mailgun validate campaign codes, and if the campaign does
        /// not exist, it will be ignored (the email will still be sent)
        /// Note! Tags are limited to a count of 200
        /// </remarks>
        /// <param name="mailPage"></param>
        /// <returns></returns>
        public override MailInformation GetMailInformation(PageData mailPage)
        {
            MailInformation mailInformation = base.GetMailInformation(mailPage);

            IPopulateCustomProperties customPropertiesProvider = mailPage as IPopulateCustomProperties;
            if (customPropertiesProvider == null)
            {
                // The base class will add custom properties if the page type
                // implements that - if NOT, we'll try to add them ourselves
                // by looking for special property names relevant to Mailgun
                var campaign = mailPage[MAILGUN_CAMPAIGN_PROPERTYNAME];
                if (campaign != null)
                {
                    mailInformation.Utm.Campaign = campaign.ToString();

                }

                // Since the Utm Campaign can be set independently, we check if it
                // is set, and use it as a Mailgun campaign too
                if(string.IsNullOrEmpty(mailInformation.Utm.Campaign) == false)
                {
                    mailInformation.CustomProperties.Add("o:campaign", mailInformation.Utm.Campaign);
                }

                if (mailPage[MAILGUN_TAG_PROPERTYNAME] != null)
                {
                    mailInformation.CustomProperties.Add("o:tag", mailPage[MAILGUN_TAG_PROPERTYNAME]);
                }
            }
            return mailInformation;
        }
开发者ID:tsolbjor,项目名称:Newsletter,代码行数:42,代码来源:MailSenderMailgun.cs

示例13: GetPageTags

        private IEnumerable<string> GetPageTags(PageData page)
        {
            var pageType = _pageTypeRepository.Load(page.PageTypeID);

            return pageType.PropertyDefinitions
                .Where(TagsHelper.IsTagProperty)
                .SelectMany(x => GetPropertyTags(page, x));
        }
开发者ID:sebastianbrand,项目名称:Tags,代码行数:8,代码来源:TagsModule.cs

示例14: EditAlbum

        public ActionResult EditAlbum(string albumName, int page = 1)
        {
            ViewBag.AlbumName = albumName;
            string login = User.Identity.Name;
            var photos = new PageData<PhotoOfAlbumDTO>(photoService.GetPhotosOfAlbum(login, albumName), page);

            return View(photos);
        }
开发者ID:BunjakMaxim,项目名称:BSU.ASP.15.01.Project,代码行数:8,代码来源:AlbumController.cs

示例15: Page

        /// <summary>
        /// Initializes a new instance of the <see cref="Page"/> class.
        /// </summary>
        /// <param name="client"><see cref="T:TcmCoreService.Client" /></param>
        /// <param name="pageData"><see cref="T:Tridion.ContentManager.CoreService.Client.PageData" /></param>
        protected Page(Client client, PageData pageData)
            : base(client, pageData)
        {
            if (pageData == null)
                throw new ArgumentNullException("pageData");

            mPageData = pageData;
        }
开发者ID:TcmExtensions,项目名称:TcmCoreService,代码行数:13,代码来源:Page.cs


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