本文整理匯總了C#中Orchard.ContentManagement.ContentItem.Get方法的典型用法代碼示例。如果您正苦於以下問題:C# ContentItem.Get方法的具體用法?C# ContentItem.Get怎麽用?C# ContentItem.Get使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Orchard.ContentManagement.ContentItem
的用法示例。
在下文中一共展示了ContentItem.Get方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: GetUniqueIdentifier
private static string GetUniqueIdentifier(ContentItem item)
{
string slug = null;
if (item.Has<AutoroutePart>())
{
var route = item.Get<AutoroutePart>();
slug = route.Path;
}
return string.Format("{0} {1}", item.Id, slug);
}
示例2: GetUniqueIdentifier
public string GetUniqueIdentifier(ContentItem item)
{
string slug = null;
if (item.Has<RoutePart>())
{
var route = item.Get<RoutePart>();
slug = route.Slug;
}
return string.Format("{0} {1}", item.Id, slug);
}
示例3: GetRouteValues
private static RouteValueDictionary GetRouteValues(IContentItemDriver driver, ContentItem contentItem) {
//TODO: (erikpo) Need to rearrange ContentItemDriver so reflection isn't needed here
var driverType = driver.GetType();
var method = driverType.GetMethod("GetDisplayRouteValues");
if (method != null) {
return (RouteValueDictionary)method.Invoke(driver, new object[] {contentItem.Get(driverType.BaseType.GetGenericArguments()[0])});
}
return null;
}
示例4: SetupTagCloudLoader
private void SetupTagCloudLoader(ContentItem item) {
var cloudPart = (TagCloudPart) item.Get(typeof (TagCloudPart));
cloudPart._tagCounts.Loader(tags =>
_tagCloudService.GetPopularTags(cloudPart.Buckets, cloudPart.Slug).ToList());
}
示例5: SetupTagCloudLoader
private void SetupTagCloudLoader(ContentItem item)
{
var cloudPart = (LocalizedTagCloudPart)item.Get(typeof(LocalizedTagCloudPart));
cloudPart._tags.Loader(() => _tagsService.GetLocalizedTags().ToList());
}