本文整理匯總了C#中umbraco.MacroEngines.DynamicNode.GetPropertyValue方法的典型用法代碼示例。如果您正苦於以下問題:C# DynamicNode.GetPropertyValue方法的具體用法?C# DynamicNode.GetPropertyValue怎麽用?C# DynamicNode.GetPropertyValue使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類umbraco.MacroEngines.DynamicNode
的用法示例。
在下文中一共展示了DynamicNode.GetPropertyValue方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: GetRelatedLinks
public static List<RelatedLink> GetRelatedLinks(string property, DynamicNode model)
{
var rlinks = new List<RelatedLink>();
if (string.IsNullOrEmpty(model.GetPropertyValue(property)))
{
return rlinks;
}
foreach (var item in (IEnumerable<dynamic>)JsonConvert.DeserializeObject(model.GetPropertyValue(property)))
{
var result = new RelatedLink();
result.Url = (bool)item.isInternal ? new DynamicNode(item["internal"]).Url : item.link;
result.Target = (bool)item.newWindow ? "_blank" : null;
result.Caption = item.caption;
rlinks.Add(result);
}
return rlinks;
}
示例2: MapToBlogPost
private static BlogPost MapToBlogPost(DynamicNode post)
{
return new BlogPost
{
Id = post.Id,
Author = GetAuthor(post.GetPropertyValue("uBlogsyPostAuthor")),
Date = DateTime.Parse(post.GetPropertyValue("uBlogsyPostDate", DateTime.UtcNow.ToString("dd MMM yyyy"))).ToString("dd MMM yyyy"),
Title = post.GetPropertyValue("uBlogsyContentTitle", "Sorry, nothing found").Wikify(),
Summary = post.GetPropertyValue("uBlogsyContentSummary", "Sorry, nothing found").Wikify(),
Content = post.GetPropertyValue("uBlogsyContentBody", "Sorry, nothing found").Wikify(),
Image = GetImageUrl(post.GetPropertyValue("uBlogsyPostImage"))
};
}
示例3: RichText
public static IHtmlString RichText(this RazorLibraryCore ctx, DynamicNode item, string alias)
{
return new LazyHtmlString(() => umbraco.library.RenderMacroContent(item.GetPropertyValue(alias), ctx.Node.Id));
}