Beispiel #1
0
        /// <exclude />
        public PageUrl(PublicationScope publicationScope, CultureInfo locale, Guid pageId, PageUrlType urlType)
        {
            Verify.ArgumentNotNull(locale, "locale");
            Verify.ArgumentCondition(pageId != Guid.Empty, "pageId", "PageId should not be an empty guid.");

            this.PublicationScope = publicationScope;
            Locale = locale;
            PageId = pageId;
            UrlType = urlType;
        }
        /// <exclude />
        public PageUrl(PublicationScope publicationScope, CultureInfo locale, Guid pageId, PageUrlType urlType)
        {
            Verify.ArgumentNotNull(locale, "locale");
            Verify.ArgumentCondition(pageId != Guid.Empty, "pageId", "PageId should not be an empty guid.");

            this.PublicationScope = publicationScope;
            Locale  = locale;
            PageId  = pageId;
            UrlType = urlType;
        }
        private static UrlKind ToUrlKind(PageUrlType pageUrlType)
        {
            switch (pageUrlType)
            {
            case PageUrlType.Public:
                return(UrlKind.Public);

            case PageUrlType.Internal:
                return(UrlKind.Internal);

            case PageUrlType.Friendly:
                return(UrlKind.Friendly);
            }
            return(UrlKind.Undefined);
        }
        /// <summary>
        /// Builds a url of the the specified URL type.
        /// </summary>
        /// <param name="urlType">Type of the URL.</param>
        /// <returns></returns>
        public UrlBuilder Build(PageUrlType urlType)
        {
            IPage page = GetPage();

            if (page == null)
            {
                return(null);
            }

            PageUrlData pageUrlData = new PageUrlData(page);

            string url = PageUrls.BuildUrl(pageUrlData, ToUrlKind(urlType), new UrlSpace());

            return(url != null ? new UrlBuilder(url) : null);
        }
Beispiel #5
0
 private static UrlKind ToUrlKind(PageUrlType pageUrlType)
 {
     switch (pageUrlType)
     {
         case PageUrlType.Public:
             return UrlKind.Public;
         case PageUrlType.Internal:
             return UrlKind.Internal;
         case PageUrlType.Friendly:
             return UrlKind.Friendly;
     }
     return UrlKind.Undefined;
 }
Beispiel #6
0
        /// <summary>
        /// Builds a url of the the specified URL type.
        /// </summary>
        /// <param name="urlType">Type of the URL.</param>
        /// <returns></returns>
        public UrlBuilder Build(PageUrlType urlType)
        {
            IPage page = GetPage();
            if(page == null)
            {
                return null;
            }

            PageUrlData pageUrlData = new PageUrlData(page);

            string url = PageUrls.BuildUrl(pageUrlData, ToUrlKind(urlType), new UrlSpace());
            return url != null ? new UrlBuilder(url) : null;
        }