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

C# Core.SiteData类代码示例

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

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



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

示例1: BlogDatePathParser

        public BlogDatePathParser(SiteData site, string folderPath)
        {
            _filename = folderPath;
            _site = site;

            ParseString();
        }
开发者ID:ninianne98,项目名称:CarrotCakeCMS,代码行数:7,代码来源:SiteData.cs


示例2: BlogDatePathParser

        public BlogDatePathParser(SiteData site)
        {
            _FileName = SiteData.CurrentScriptName;
            _site = site;

            ParseString();
        }
开发者ID:mjohn,项目名称:CarrotCakeCMS,代码行数:7,代码来源:SiteData.cs


示例3: SetVals

		private void SetVals(SiteData s, List<ContentPageExport> pages) {
			CarrotCakeVersion = SiteData.CarrotCakeCMSVersion;
			ExportDate = DateTime.UtcNow;

			NewSiteID = Guid.NewGuid();

			TheSite = s;
			ThePages = pages;

			if (TheSite == null) {
				TheSite = new SiteData();
				TheSite.SiteID = Guid.NewGuid();
			}
			if (ThePages == null) {
				ThePages = new List<ContentPageExport>();
			}

			OriginalSiteID = TheSite.SiteID;

			foreach (var w in ThePages) {
				w.OriginalSiteID = NewSiteID;
			}

			TheCategories = s.GetCategoryList();
			TheTags = s.GetTagList();
			TheSnippets = s.GetContentSnippetList();
		}
开发者ID:ithanshui,项目名称:CarrotCakeCMS-MVC,代码行数:27,代码来源:SiteExport.cs


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


示例5: SiteExport

		public SiteExport() {
			CarrotCakeVersion = SiteData.CarrotCakeCMSVersion;
			ExportDate = DateTime.UtcNow;

			TheSite = new SiteData();
			ThePages = new List<ContentPageExport>();

			TheCategories = new List<ContentCategory>();
			TheTags = new List<ContentTag>();
			TheSnippets = new List<ContentSnippet>();
		}
开发者ID:ithanshui,项目名称:CarrotCakeCMS-MVC,代码行数:11,代码来源:SiteExport.cs


示例6: OnInit

		protected override void OnInit(EventArgs e) {
			base.OnInit(e);

			pph = new PageProcessingHelper(this.Page);

			pph.LoadData();
			if (pph.ThePage != null) {
				theSite = pph.TheSite;
				pageContents = pph.ThePage;
				pageWidgets = pph.ThePageWidgets;
			}

			if (SiteData.IsWebView) {
				pph.LoadPageControls();
			}
		}
开发者ID:tridipkolkata,项目名称:CarrotCakeCMS,代码行数:16,代码来源:GenericMasterPage.Master.cs


示例7: GetFileInfoFromList

		protected BasicContentData GetFileInfoFromList(SiteData site, string sFilename) {
			if (sitePageList == null || sitePageList.Count < 1 || iAccessCounter % 25 == 0) {
				sitePageList = site.GetFullSiteFileList();
				iAccessCounter = 0;
			}
			iAccessCounter++;

			BasicContentData pageData = (from m in sitePageList
										 where m.FileName.ToLower() == sFilename.ToLower()
										 select m).FirstOrDefault();

			if (pageData == null) {
				using (ISiteNavHelper navHelper = SiteNavFactory.GetSiteNavHelper()) {
					pageData = BasicContentData.CreateBasicContentDataFromSiteNav(navHelper.GetLatestVersion(site.SiteID, false, sFilename.ToLower()));
				}
			}

			return pageData;
		}
开发者ID:tridipkolkata,项目名称:CarrotCakeCMS,代码行数:19,代码来源:SiteImport.aspx.cs


示例8: Page_Load

		protected void Page_Load(object sender, EventArgs e) {
			Master.ActivateTab(AdminBaseMasterPage.SectionID.SiteIndex);
			guidSiteID = GetGuidIDFromQuery();

			btnAddUsers.Visible = SecurityData.IsAdmin;
			btnRemove.Visible = SecurityData.IsAdmin;

			theSite = SiteData.GetSiteByID(guidSiteID);

			if (theSite != null) {
				litID.Text = theSite.SiteID.ToString();
				litSiteName.Text = theSite.SiteName;
				litTagline.Text = theSite.SiteTagline;
				litURL.Text = theSite.MainURL;
			}

			if (!IsPostBack) {
				GetUserList();
			}
		}
开发者ID:tridipkolkata,项目名称:CarrotCakeCMS,代码行数:20,代码来源:SiteDetail.aspx.cs


示例9: GetBlogHeadingFromURL

        public string GetBlogHeadingFromURL(SiteData currentSite, string sFilterPath)
        {
            Guid siteID = currentSite.SiteID;

            string sTitle = String.Empty;

            if (currentSite.CheckIsBlogCategoryPath(sFilterPath)) {
                vw_carrot_CategoryURL query = CompiledQueries.cqGetCategoryByURL(db, siteID, sFilterPath);
                sTitle = query.CategoryText;
            }
            if (currentSite.CheckIsBlogTagPath(sFilterPath)) {
                vw_carrot_TagURL query = CompiledQueries.cqGetTagByURL(db, siteID, sFilterPath);
                sTitle = query.TagText;
            }
            if (currentSite.CheckIsBlogEditorFolderPath(sFilterPath)) {
                vw_carrot_EditorURL query = CompiledQueries.cqGetEditorByURL(db, siteID, sFilterPath);
                ExtendedUserData usr = new ExtendedUserData(query.UserId);
                sTitle = usr.ToString();
            }
            if (currentSite.CheckIsBlogDateFolderPath(sFilterPath)) {
                BlogDatePathParser p = new BlogDatePathParser(currentSite, sFilterPath);
                TimeSpan ts = p.DateEndUTC - p.DateBeginUTC;

                int daysDelta = ts.Days;
                if (daysDelta > 90) {
                    sTitle = "Year " + p.DateBegin.ToString("yyyy");
                }
                if (daysDelta < 36) {
                    sTitle = p.DateBegin.ToString("MMMM yyyy");
                }
                if (daysDelta < 5) {
                    sTitle = p.DateBegin.ToString("MMMM d, yyyy");
                }
            }
            if (currentSite.CheckIsSiteSearchPath(sFilterPath)) {
                sTitle = "Search Results";
            }

            return sTitle;
        }
开发者ID:sunsiz,项目名称:CarrotCakeCMS-MVC,代码行数:40,代码来源:SiteNavHelperReal.cs


示例10: GetBlogHeadingFromURL

        public string GetBlogHeadingFromURL(SiteData currentSite, string sFilterPath)
        {
            string sTitle = String.Empty;

            if (currentSite.CheckIsBlogCategoryPath(sFilterPath)) {
                sTitle = "Category 1";
            }
            if (currentSite.CheckIsBlogTagPath(sFilterPath)) {
                sTitle = "Tag 1";
            }
            if (currentSite.CheckIsBlogEditorFolderPath(sFilterPath)) {
                sTitle = "Editor 1";
            }
            if (currentSite.CheckIsBlogDateFolderPath(sFilterPath)) {
                sTitle = DateTime.UtcNow.ToString("MMMM yyyy");
            }
            if (currentSite.CheckIsSiteSearchPath(sFilterPath)) {
                sTitle = "Search Results";
            }

            return sTitle;
        }
开发者ID:sunsiz,项目名称:CarrotCakeCMS,代码行数:22,代码来源:SiteNavHelperMock.cs


示例11: RssTextLink

		public static MvcHtmlString RssTextLink(SiteData.RSSFeedInclude mode, string linkText = "RSS", object linkAttributes = null) {
			var anchorBuilder = new TagBuilder("a");
			anchorBuilder.MergeAttribute("href", String.Format("{0}?type={1}", CarrotCakeHtml.RssUri, mode));

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

			anchorBuilder.InnerHtml = linkText;

			return MvcHtmlString.Create(anchorBuilder.ToString());
		}
开发者ID:ithanshui,项目名称:CarrotCakeCMS-MVC,代码行数:11,代码来源:CarrotCakeHtml.cs


示例12: Load

 public void Load(SiteData model)
 {
     this.Site = model;
 }
开发者ID:sunsiz,项目名称:CarrotCakeCMS-MVC,代码行数:4,代码来源:SiteDataModel.cs


示例13: SiteExport

 public SiteExport(SiteData s, List<ContentPageExport> pages)
 {
     SetVals(s, pages);
 }
开发者ID:ninianne98,项目名称:CarrotCakeCMS-MVC,代码行数:4,代码来源:SiteExport.cs


示例14: GetFilteredContentPagedCount

        public int GetFilteredContentPagedCount(SiteData currentSite, string sFilterPath, bool bActiveOnly)
        {
            IQueryable<vw_carrot_Content> query1 = null;
            Guid siteID = currentSite.SiteID;
            bool bFound = false;

            if (currentSite.CheckIsBlogCategoryPath(sFilterPath)) {
                query1 = CannedQueries.GetContentByCategoryURL(db, siteID, bActiveOnly, sFilterPath);
                bFound = true;
            }
            if (currentSite.CheckIsBlogTagPath(sFilterPath)) {
                query1 = CannedQueries.GetContentByTagURL(db, siteID, bActiveOnly, sFilterPath);
                bFound = true;
            }
            if (currentSite.CheckIsBlogEditorFolderPath(sFilterPath)) {
                query1 = CannedQueries.GetContentByUserURL(db, siteID, bActiveOnly, sFilterPath);
                bFound = true;
            }
            if (currentSite.CheckIsBlogDateFolderPath(sFilterPath)) {
                BlogDatePathParser p = new BlogDatePathParser(currentSite, sFilterPath);
                query1 = CannedQueries.GetLatestBlogListDateRange(db, siteID, p.DateBeginUTC, p.DateEndUTC, bActiveOnly);
                bFound = true;
            }
            if (!bFound) {
                query1 = CannedQueries.GetLatestBlogList(db, siteID, bActiveOnly);
            }

            return query1.Count();
        }
开发者ID:ninianne98,项目名称:CarrotCakeCMS,代码行数:29,代码来源:ContentPageHelper.cs


示例15: Save

        public void Save()
        {
            if (!this.IsWidgetPendingDelete) {

                SiteData site = new SiteData(CompiledQueries.cqGetSiteFromRootContentID(db, this.Root_ContentID));

                carrot_Widget w = CompiledQueries.cqGetRootWidget(db, this.Root_WidgetID);

                bool bAdd = false;
                if (w == null) {
                    bAdd = true;
                    w = new carrot_Widget();
                }

                if (this.Root_WidgetID == Guid.Empty) {
                    this.Root_WidgetID = Guid.NewGuid();
                }

                if (this.GoLiveDate.Year < 1900) {
                    this.GoLiveDate = site.Now.AddMinutes(-5);
                }
                if (this.RetireDate.Year < 1900) {
                    this.RetireDate = site.Now.AddYears(200);
                }

                w.Root_WidgetID = this.Root_WidgetID;

                w.WidgetOrder = this.WidgetOrder;
                w.Root_ContentID = this.Root_ContentID;
                w.PlaceholderName = this.PlaceholderName;
                w.ControlPath = this.ControlPath.Replace("~~/", "~/");
                w.WidgetActive = this.IsWidgetActive;
                w.GoLiveDate = site.ConvertSiteTimeToUTC(this.GoLiveDate);
                w.RetireDate = site.ConvertSiteTimeToUTC(this.RetireDate);

                carrot_WidgetData wd = new carrot_WidgetData();
                wd.Root_WidgetID = w.Root_WidgetID;
                wd.WidgetDataID = Guid.NewGuid();
                wd.IsLatestVersion = true;
                wd.ControlProperties = this.ControlProperties;
                wd.EditDate = DateTime.UtcNow;

                carrot_WidgetData oldWD = CompiledQueries.cqGetWidgetDataByRootID(db, this.Root_WidgetID);

                //only add a new entry if the widget has some sort of change in the data stored.
                if (oldWD != null) {
                    if (oldWD.ControlProperties != wd.ControlProperties) {
                        oldWD.IsLatestVersion = false;
                        db.carrot_WidgetDatas.InsertOnSubmit(wd);
                    }
                } else {
                    db.carrot_WidgetDatas.InsertOnSubmit(wd);
                }

                if (bAdd) {
                    db.carrot_Widgets.InsertOnSubmit(w);
                }

                db.SubmitChanges();

            } else {

                DeleteAll();

            }
        }
开发者ID:mjohn,项目名称:CarrotCakeCMS,代码行数:66,代码来源:Widget.cs


示例16: CheckForSpecialURL

        public static string CheckForSpecialURL(SiteData site)
        {
            string sRequestedURL = "/";

            if (IsWebView) {
                sRequestedURL = CurrentScriptName;
                string sFileRequested = sRequestedURL;

                if (!sRequestedURL.ToLower().StartsWith(AdminFolderPath) && site != null) {
                    if (sFileRequested.ToLower().StartsWith(site.BlogFolderPath.ToLower())) {
                        if (site.GetSpecialFilePathPrefixes().Where(x => sFileRequested.ToLower().StartsWith(x)).Count() > 0) {
                            if (site.Blog_Root_ContentID.HasValue) {
                                using (SiteNavHelper navHelper = new SiteNavHelper()) {
                                    SiteNav blogNavPage = navHelper.GetLatestVersion(site.SiteID, site.Blog_Root_ContentID.Value);
                                    if (blogNavPage != null) {
                                        sRequestedURL = blogNavPage.FileName;
                                    }
                                }
                            }
                        }
                    }
                }
            }

            return sRequestedURL;
        }
开发者ID:mjohn,项目名称:CarrotCakeCMS,代码行数:26,代码来源:SiteData.cs


示例17: GetSiteFromCache

 public static SiteData GetSiteFromCache(Guid siteID)
 {
     string ContentKey = SiteKeyPrefix + siteID.ToString();
     SiteData currentSite = null;
     if (IsWebView) {
         try { currentSite = (SiteData)HttpContext.Current.Cache[ContentKey]; } catch { }
         if (currentSite == null) {
             currentSite = GetSiteByID(siteID);
             if (currentSite != null) {
                 HttpContext.Current.Cache.Insert(ContentKey, currentSite, null, DateTime.Now.AddMinutes(5), Cache.NoSlidingExpiration);
             } else {
                 HttpContext.Current.Cache.Remove(ContentKey);
             }
         }
     } else {
         currentSite = new SiteData();
         currentSite.SiteID = Guid.Empty;
         currentSite.SiteName = "MOCK SITE";
         currentSite.SiteTagline = "MOCK SITE TAGLINE";
         currentSite.MainURL = "http://localhost";
         currentSite.Blog_FolderPath = "archive";
         currentSite.Blog_CategoryPath = "category";
         currentSite.Blog_TagPath = "tag";
         currentSite.Blog_DatePath = "date";
         currentSite.Blog_EditorPath = "author";
         currentSite.TimeZoneIdentifier = "UTC";
         currentSite.Blog_DatePattern = "yyyy/MM/dd";
     }
     return currentSite;
 }
开发者ID:mjohn,项目名称:CarrotCakeCMS,代码行数:30,代码来源:SiteData.cs


示例18: GetFilteredContentByIDPagedCount

		public int GetFilteredContentByIDPagedCount(SiteData currentSite, List<Guid> lstCategoryGUIDs, List<string> lstCategorySlugs, bool bActiveOnly) {
			return 50;
		}
开发者ID:ithanshui,项目名称:CarrotCakeCMS-MVC,代码行数:3,代码来源:SiteNavHelperMock.cs


示例19: GetBlogHeadingFromURL

        public PageViewType GetBlogHeadingFromURL(SiteData currentSite, string sFilterPath)
        {
            Guid siteID = currentSite.SiteID;
            PageViewType pvt = new PageViewType { ExtraTitle = "", CurrentViewType = PageViewType.ViewType.SinglePage, RawValue = null };

            string sTitle = String.Empty;

            if (currentSite.CheckIsBlogCategoryPath(sFilterPath)) {
                pvt.CurrentViewType = PageViewType.ViewType.CategoryIndex;
                vw_carrot_CategoryURL query = CompiledQueries.cqGetCategoryByURL(db, siteID, sFilterPath);
                if (query != null) {
                    sTitle = query.CategoryText;
                    pvt.RawValue = query.CategoryText;
                }
            }
            if (currentSite.CheckIsBlogTagPath(sFilterPath)) {
                pvt.CurrentViewType = PageViewType.ViewType.TagIndex;
                vw_carrot_TagURL query = CompiledQueries.cqGetTagByURL(db, siteID, sFilterPath);
                if (query != null) {
                    sTitle = query.TagText;
                    pvt.RawValue = query.TagText;
                }
            }
            if (currentSite.CheckIsBlogEditorFolderPath(sFilterPath)) {
                pvt.CurrentViewType = PageViewType.ViewType.AuthorIndex;
                vw_carrot_EditorURL query = CompiledQueries.cqGetEditorByURL(db, siteID, sFilterPath);
                if (query != null) {
                    ExtendedUserData usr = new ExtendedUserData(query.UserId);
                    sTitle = usr.ToString();
                    pvt.RawValue = usr;
                }
            }
            if (currentSite.CheckIsBlogDateFolderPath(sFilterPath)) {
                pvt.CurrentViewType = PageViewType.ViewType.DateIndex;

                BlogDatePathParser p = new BlogDatePathParser(currentSite, sFilterPath);
                TimeSpan ts = p.DateEndUTC - p.DateBeginUTC;

                pvt.RawValue = p.DateBegin;

                int daysDelta = ts.Days;
                if (daysDelta < 400 && daysDelta > 90) {
                    sTitle = p.DateBegin.ToString("yyyy");
                    pvt.CurrentViewType = PageViewType.ViewType.DateYearIndex;
                }
                if (daysDelta < 36 && daysDelta > 3) {
                    sTitle = p.DateBegin.ToString("MMMM yyyy");
                    pvt.CurrentViewType = PageViewType.ViewType.DateMonthIndex;
                }
                if (daysDelta < 5) {
                    sTitle = p.DateBegin.ToString("MMMM d, yyyy");
                    pvt.CurrentViewType = PageViewType.ViewType.DateDayIndex;
                }
            }

            if (currentSite.CheckIsSiteSearchPath(sFilterPath)) {
                pvt.CurrentViewType = PageViewType.ViewType.SearchResults;
                string sSearchTerm = "";

                if (HttpContext.Current.Request.QueryString[SiteData.SearchQueryParameter] != null) {
                    sSearchTerm = HttpContext.Current.Request.QueryString[SiteData.SearchQueryParameter].ToString();
                }

                pvt.RawValue = sSearchTerm;
                sTitle = string.Format(" '{0}' ", sSearchTerm);
            }

            pvt.ExtraTitle = sTitle;

            return pvt;
        }
开发者ID:ninianne98,项目名称:CarrotCakeCMS,代码行数:71,代码来源:ContentPageHelper.cs


示例20: GetFilteredContentPagedList

		public List<SiteNav> GetFilteredContentPagedList(SiteData currentSite, string sFilterPath, bool bActiveOnly, int pageSize, int pageNumber, string sortField, string sortDir) {
			return SiteNavHelper.GetSamplerFakeNav(pageSize);
		}
开发者ID:ithanshui,项目名称:CarrotCakeCMS-MVC,代码行数:3,代码来源:SiteNavHelperMock.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# Core.SiteNav类代码示例发布时间:2022-05-24
下一篇:
C# Core.SearchParameterObject类代码示例发布时间: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