本文整理汇总了C#中MrCMS.Entities.Documents.Web.Webpage.GetMetadata方法的典型用法代码示例。如果您正苦于以下问题:C# Webpage.GetMetadata方法的具体用法?C# Webpage.GetMetadata怎么用?C# Webpage.GetMetadata使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MrCMS.Entities.Documents.Web.Webpage
的用法示例。
在下文中一共展示了Webpage.GetMetadata方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetEditPageViewData
public void SetEditPageViewData(ViewDataDictionary viewData, Webpage page)
{
DocumentMetadata documentMetadata = page.GetMetadata();
if (documentMetadata != null)
{
viewData["EditView"] = documentMetadata.EditPartialView;
}
viewData["edit-tabs"] = _getWebpageEditTabsService.GetEditTabs(page);
}
示例2: GetTypeDefaultLayout
private Layout GetTypeDefaultLayout(Webpage webpage)
{
var documentMetadata = webpage.GetMetadata();
var layoutId = _pageDefaultsSettings.GetLayoutId(documentMetadata.Type);
if (layoutId.HasValue)
{
var layout = _session.Get<Layout>(layoutId);
if (layout != null)
{
return layout;
}
}
return null;
}
示例3: GetValidParents
public IEnumerable<SelectListItem> GetValidParents(Webpage webpage)
{
List<DocumentMetadata> validParentTypes = DocumentMetadataHelper.GetValidParentTypes(webpage);
List<string> validParentTypeNames =
validParentTypes.Select(documentMetadata => documentMetadata.Type.FullName).ToList();
IList<Webpage> potentialParents =
_session.QueryOver<Webpage>()
.Where(page => page.DocumentType.IsIn(validParentTypeNames) )
.Cacheable().List<Webpage>();
List<SelectListItem> result = potentialParents.Distinct()
.Where(page => !page.ActivePages.Contains(webpage))
.OrderBy(x => x.Name)
.BuildSelectItemList(page => string.Format("{0} ({1})", page.Name, page.GetMetadata().Name),
page => page.Id.ToString(),
webpage1 => webpage.Parent != null && webpage.ParentId == webpage1.Id, emptyItem: null);
if (!webpage.GetMetadata().RequiresParent)
result.Insert(0, SelectListItemHelper.EmptyItem("Root"));
return result;
}