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

C# Core.SiteNav类代码示例

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

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



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

示例1: GetContent

		public static PagePayload GetContent(SiteNav nav) {
			PagePayload page = new PagePayload();
			page.ThePage = nav.GetContentPage();

			page.Load();
			return page;
		}
开发者ID:ithanshui,项目名称:CarrotCakeCMS-MVC,代码行数:7,代码来源:PagePayload.cs


示例2: GetHomePage

		protected SiteNav GetHomePage(SiteData site) {
			if (_navHome == null) {
				using (ISiteNavHelper navHelper = SiteNavFactory.GetSiteNavHelper()) {
					_navHome = navHelper.FindHome(site.SiteID, false);
				}
			}
			return _navHome;
		}
开发者ID:ithanshui,项目名称:CarrotCakeCMS-MVC,代码行数:8,代码来源:SiteImportNativeModel.cs


示例3: SendTrackback

        public string SendTrackback(Uri targetURL, SiteNav pageNav)
        {
            this.DestinationUrl = targetURL;
            this.SourcePage = pageNav;
            this.BlogSite = SiteData.GetSiteFromCache(this.SourcePage.SiteID);

            return SendTrackback();
        }
开发者ID:sunsiz,项目名称:CarrotCakeCMS-MVC,代码行数:8,代码来源:TrackbackHelper.cs


示例4: FindHome

 public SiteNav FindHome(Guid siteID, bool bActiveOnly)
 {
     SiteNav content = null;
     vw_carrot_Content cont = CompiledQueries.FindHome(db, siteID, bActiveOnly);
     if (cont != null) {
         content = new SiteNav(cont);
     }
     return content;
 }
开发者ID:sunsiz,项目名称:CarrotCakeCMS-MVC,代码行数:9,代码来源:SiteNavHelperReal.cs


示例5: FindByFilename

 public SiteNav FindByFilename(Guid siteID, string urlFileName)
 {
     SiteNav content = null;
     vw_carrot_Content cont = CompiledQueries.GetLatestContentByURL(db, siteID, false, urlFileName);
     if (cont != null) {
         content = new SiteNav(cont);
     }
     return content;
 }
开发者ID:sunsiz,项目名称:CarrotCakeCMS-MVC,代码行数:9,代码来源:SiteNavHelperReal.cs


示例6: GetHtml

		public override string GetHtml() {
			string sFieldValue = string.Empty;

			if (this.ContentPage == null) {
				this.ContentPage = SiteData.GetCurrentPage();
			}

			SiteNav navNext = new SiteNav();

			if (this.NavigationDirection != NavDirection.Unknown) {
				using (ISiteNavHelper navHelper = SiteNavFactory.GetSiteNavHelper()) {
					if (NavigationDirection == NavDirection.Prev) {
						navNext = navHelper.GetPrevPost(SiteData.CurrentSiteID, this.ContentPage.Root_ContentID, !SecurityData.IsAuthEditor);
					}
					if (NavigationDirection == NavDirection.Next) {
						navNext = navHelper.GetNextPost(SiteData.CurrentSiteID, this.ContentPage.Root_ContentID, !SecurityData.IsAuthEditor);
					}

					if (navNext != null) {
						if (this.UseDefaultText) {
							string sField = this.CaptionDataField.ToString();

							object objData = ReflectionUtilities.GetPropertyValue(navNext, sField);
							if (objData != null) {
								sFieldValue = String.Format("{0}", objData);
							}

							this.NavigateText = sFieldValue;
						}

						this.NavigateUrl = navNext.FileName;
					} else {
						this.NavigateUrl = String.Empty;
					}
				}
			} else {
				this.NavigateUrl = String.Empty;
			}

			if (!String.IsNullOrEmpty(this.NavigateUrl)) {
				var lnkBuilder = new TagBuilder("a");
				lnkBuilder.MergeAttribute("href", this.NavigateUrl);

				lnkBuilder.InnerHtml = this.NavigateUrl;
				if (!String.IsNullOrEmpty(this.NavigateText)) {
					lnkBuilder.InnerHtml = this.NavigateText;
				}

				var lnkAttribs = (IDictionary<string, object>)HtmlHelper.AnonymousObjectToHtmlAttributes(linkAttributes);
				lnkBuilder.MergeAttributes(lnkAttribs);

				return lnkBuilder.ToString(TagRenderMode.Normal);
			} else {
				return String.Empty;
			}
		}
开发者ID:ithanshui,项目名称:CarrotCakeCMS-MVC,代码行数:56,代码来源:ContentPageComponents.cs


示例7: GetEmptyHome

		internal static SiteNav GetEmptyHome() {
			SiteNav navData = new SiteNav();
			navData.ContentID = Guid.Empty;
			navData.Root_ContentID = Guid.Empty;
			navData.SiteID = SiteData.CurrentSiteID;
			navData.TemplateFile = SiteData.DefaultDirectoryFilename;
			navData.FileName = SiteData.DefaultDirectoryFilename;
			navData.NavMenuText = "NONE";
			navData.PageHead = "NONE";
			navData.TitleBar = "NONE";
			navData.PageActive = false;
			navData.PageText = "NO PAGE CONTENT";
			navData.EditDate = DateTime.Now.Date.AddDays(-1);
			navData.CreateDate = DateTime.Now.Date.AddDays(-10);
			navData.GoLiveDate = DateTime.Now.Date.AddDays(1);
			navData.RetireDate = DateTime.Now.Date.AddDays(90);
			navData.ContentType = ContentPageType.PageType.ContentEntry;
			return navData;
		}
开发者ID:tridipkolkata,项目名称:CarrotCakeCMS,代码行数:19,代码来源:SiteNavHelper.cs


示例8: CreateBasicContentDataFromSiteNav

		public static BasicContentData CreateBasicContentDataFromSiteNav(SiteNav c) {
			BasicContentData sn = null;
			if (c != null) {
				sn = new BasicContentData();
				sn.Root_ContentID = c.Root_ContentID;
				sn.Parent_ContentID = c.Parent_ContentID;
				sn.FileName = c.FileName;
				sn.TemplateFile = c.TemplateFile;
				sn.SiteID = c.SiteID;
				sn.PageActive = c.PageActive;
				sn.CreateDate = c.CreateDate;
				sn.GoLiveDate = c.GoLiveDate;
				sn.RetireDate = c.RetireDate;
				sn.ContentType = c.ContentType;
				sn.NavOrder = c.NavOrder;
			}

			return sn;
		}
开发者ID:ithanshui,项目名称:CarrotCakeCMS-MVC,代码行数:19,代码来源:BasicContentData.cs


示例9: GetPageNavigation

 public SiteNav GetPageNavigation(Guid siteID, Guid rootContentID)
 {
     SiteNav content = null;
     vw_carrot_Content cont = CompiledQueries.GetLatestContentByID(db, siteID, false, rootContentID);
     if (cont != null) {
         content = new SiteNav(cont);
     }
     return content;
 }
开发者ID:sunsiz,项目名称:CarrotCakeCMS-MVC,代码行数:9,代码来源:SiteNavHelperReal.cs


示例10: OverridePage

		public void OverridePage(SiteNav nav) {
			this.CmsPage = PagePayload.GetContent(nav);
			this.ViewData[PagePayload.ViewDataKey] = this.CmsPage;
		}
开发者ID:ithanshui,项目名称:CarrotCakeCMS-MVC,代码行数:4,代码来源:CmsWebViewPage.cs


示例11: NavIsInCurrentTree

		public bool NavIsInCurrentTree(SiteNav nav) {
			return (nav.Root_ContentID == this.ThePage.Root_ContentID
							|| (this.ThePage.Parent_ContentID.HasValue && nav.Root_ContentID == this.ThePage.Parent_ContentID.Value)
							|| (this.ThePage.ContentType == ContentPageType.PageType.BlogEntry && this.TheSite.Blog_Root_ContentID.HasValue
										&& nav.Root_ContentID == this.TheSite.Blog_Root_ContentID.Value));
		}
开发者ID:ithanshui,项目名称:CarrotCakeCMS-MVC,代码行数:6,代码来源:PagePayload.cs


示例12: GetParentPageNavigationByNav

        private SiteNav GetParentPageNavigationByNav(Guid siteID, SiteNav navItem)
        {
            if (navItem != null) {
                if (navItem.ContentType == ContentPageType.PageType.BlogEntry) {
                    Guid? parentPageID = SiteData.GetSiteFromCache(siteID).Blog_Root_ContentID;
                    navItem.Parent_ContentID = parentPageID;
                }

                SiteNav content = null;
                if (navItem != null && navItem.Parent_ContentID.HasValue) {
                    content = new SiteNav(CompiledQueries.GetLatestContentByID(db, siteID, false, navItem.Parent_ContentID.Value));
                }

                return content;
            } else {
                return null;
            }
        }
开发者ID:sunsiz,项目名称:CarrotCakeCMS-MVC,代码行数:18,代码来源:SiteNavHelperReal.cs


示例13: GetPageCrumbNavByContent

        private List<SiteNav> GetPageCrumbNavByContent(vw_carrot_Content content, bool bActiveOnly)
        {
            Guid siteID = Guid.Empty;
            Guid rootContentID = Guid.Empty;
            Guid? parentContentID = null;
            int iOrder = 1000000;

            List<SiteNav> lstContent = new List<SiteNav>();

            if (content != null) {
                rootContentID = content.Root_ContentID;
                siteID = content.SiteID;
                parentContentID = content.Parent_ContentID;
                SiteNav sn = new SiteNav(content);
                sn.NavOrder = iOrder + 100;
                lstContent.Add(sn);
            }

            if (rootContentID != Guid.Empty) {
                Guid? gLast = parentContentID;

                while (gLast.HasValue) {
                    SiteNav nav = GetPageNavigation(siteID, gLast.Value, false);
                    gLast = null;

                    if (nav != null) {
                        nav.NavOrder = iOrder;
                        lstContent.Add(nav);
                        iOrder--;

                        gLast = nav.Parent_ContentID;
                    }
                }
            }

            SiteNav home = FindHome(siteID, false);
            home.NavOrder = 0;

            if (lstContent.Where(x => x.Root_ContentID == home.Root_ContentID).Count() < 1) {
                lstContent.Add(home);
            }

            return lstContent.OrderBy(x => x.NavOrder).Where(x => x.PageActive == true && x.IsRetired == false && x.IsUnReleased == false || bActiveOnly == false).ToList();
        }
开发者ID:sunsiz,项目名称:CarrotCakeCMS-MVC,代码行数:44,代码来源:SiteNavHelperReal.cs


示例14: LoadData

        protected void LoadData()
        {
            ParentPageNav = GetParentPage();

            if (ShowSecondLevel) {
                lstTwoLevelNav = navHelper.GetTwoLevelNavigation(SiteData.CurrentSiteID, !SecurityData.IsAuthEditor);
            } else {
                lstTwoLevelNav = navHelper.GetTopNavigation(SiteData.CurrentSiteID, !SecurityData.IsAuthEditor);
            }

            lstTwoLevelNav.RemoveAll(x => x.ShowInSiteNav == false);
            lstTwoLevelNav.ToList().ForEach(q => IdentifyLinkAsInactive(q));
        }
开发者ID:ninianne98,项目名称:CarrotCakeCMS,代码行数:13,代码来源:TwoLevelNavigationTemplate.cs


示例15: GetLatestVersion

		public SiteNav GetLatestVersion(Guid siteID, bool bActiveOnly, string sPage) {
			SiteNav content = null;
			vw_carrot_Content cont = CompiledQueries.GetLatestContentByURL(db, siteID, bActiveOnly, sPage);
			if (cont != null) {
				content = new SiteNav(cont);
			}
			return content;
		}
开发者ID:tridipkolkata,项目名称:CarrotCakeCMS,代码行数:8,代码来源:SiteNavHelperReal.cs


示例16: GetPageNavigation

		public SiteNav GetPageNavigation(Guid siteID, string sPage) {
			SiteNav content = null;
			vw_carrot_Content cont = CompiledQueries.GetLatestContentByURL(db, siteID, false, sPage);
			if (cont != null) {
				content = new SiteNav(cont);
			}
			return content;
		}
开发者ID:tridipkolkata,项目名称:CarrotCakeCMS,代码行数:8,代码来源:SiteNavHelperReal.cs


示例17: ConstructedCanonicalURL

 public string ConstructedCanonicalURL(SiteNav nav)
 {
     return RemoveDupeSlashesURL(this.MainCanonicalURL + nav.FileName);
 }
开发者ID:mjohn,项目名称:CarrotCakeCMS,代码行数:4,代码来源:SiteData.cs


示例18: NavIsCurrentPage

		public bool NavIsCurrentPage(SiteNav nav) {
			return this.ThePage.Root_ContentID == nav.Root_ContentID;
		}
开发者ID:ithanshui,项目名称:CarrotCakeCMS-MVC,代码行数:3,代码来源:PagePayload.cs


示例19: IdentifyLinkAsInactive

 public static SiteNav IdentifyLinkAsInactive(SiteNav nav)
 {
     return CMSConfigHelper.IdentifyLinkAsInactive(nav);
 }
开发者ID:mjohn,项目名称:CarrotCakeCMS,代码行数:4,代码来源:BaseServerControl.cs


示例20: GetSamplerView

        internal static SiteNav GetSamplerView()
        {
            string sFile2 = GetSampleBody();

            SiteNav navNew = new SiteNav();
            navNew.Root_ContentID = Guid.NewGuid();
            navNew.ContentID = Guid.NewGuid();

            navNew.NavOrder = -1;
            navNew.TitleBar = "Template Preview - TITLE";
            navNew.NavMenuText = "Template PV - NAV"; ;
            navNew.PageHead = "Template Preview - HEAD";
            navNew.PageActive = true;
            navNew.ShowInSiteNav = true;
            navNew.ShowInSiteMap = true;

            navNew.EditDate = DateTime.Now.Date.AddHours(-8);
            navNew.CreateDate = DateTime.Now.Date.AddHours(-38);
            navNew.GoLiveDate = navNew.EditDate.AddHours(-5);
            navNew.RetireDate = navNew.CreateDate.AddYears(5);
            navNew.PageText = "<h2>Content CENTER</h2>\r\n";

            navNew.TemplateFile = SiteData.PreviewTemplateFile;
            if (SiteData.IsWebView) {
                navNew.FileName = SiteData.PreviewTemplateFilePage + "?" + HttpContext.Current.Request.QueryString.ToString();
            } else {
                navNew.FileName = SiteData.PreviewTemplateFilePage + "?sampler=true";
            }

            navNew.PageText = "<h2>Content CENTER</h2>\r\n" + sFile2;

            navNew.SiteID = SiteData.CurrentSiteID;
            navNew.Parent_ContentID = null;
            navNew.ContentType = ContentPageType.PageType.ContentEntry;

            navNew.EditUserId = SecurityData.CurrentUserGuid;

            return navNew;
        }
开发者ID:ninianne98,项目名称:CarrotCakeCMS,代码行数:39,代码来源:SiteNavHelper.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# Data.CarrotCMSDataContext类代码示例发布时间:2022-05-24
下一篇:
C# Core.SiteData类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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