本文整理汇总了C#中Carrotware.CMS.Core.SiteNav类的典型用法代码示例。如果您正苦于以下问题:C# SiteNav类的具体用法?C# SiteNav怎么用?C# SiteNav使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SiteNav类属于Carrotware.CMS.Core命名空间,在下文中一共展示了SiteNav类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetContent
public static PagePayload GetContent(SiteNav nav) {
PagePayload page = new PagePayload();
page.ThePage = nav.GetContentPage();
page.Load();
return page;
}
示例2: GetHomePage
protected SiteNav GetHomePage(SiteData site) {
if (_navHome == null) {
using (ISiteNavHelper navHelper = SiteNavFactory.GetSiteNavHelper()) {
_navHome = navHelper.FindHome(site.SiteID, false);
}
}
return _navHome;
}
示例3: SendTrackback
public string SendTrackback(Uri targetURL, SiteNav pageNav)
{
this.DestinationUrl = targetURL;
this.SourcePage = pageNav;
this.BlogSite = SiteData.GetSiteFromCache(this.SourcePage.SiteID);
return SendTrackback();
}
示例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;
}
示例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;
}
示例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;
}
}
示例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;
}
示例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;
}
示例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;
}
示例10: OverridePage
public void OverridePage(SiteNav nav) {
this.CmsPage = PagePayload.GetContent(nav);
this.ViewData[PagePayload.ViewDataKey] = this.CmsPage;
}
示例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));
}
示例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;
}
}
示例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();
}
示例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));
}
示例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;
}