本文整理汇总了C#中IEngine.ResolveAdapter方法的典型用法代码示例。如果您正苦于以下问题:C# IEngine.ResolveAdapter方法的具体用法?C# IEngine.ResolveAdapter怎么用?C# IEngine.ResolveAdapter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IEngine
的用法示例。
在下文中一共展示了IEngine.ResolveAdapter方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Definitions
private static string Definitions(HtmlHelper html, IEngine engine, ContentItem item, ControlPanelState state)
{
if (state == ControlPanelState.DragDrop)
{
StringBuilder sb = new StringBuilder();
var a = engine.ResolveAdapter<PartsAdapter>(item);
foreach (var d in UI.WebControls.ControlPanel.GetPartDefinitions(a, item, null, html.ViewContext.HttpContext.User))
{
foreach (var t in a.GetTemplates(item, d))
{
sb.AppendFormat(
"<div id='{0}' title='{1}' data-type='{2}' data-template='{3}' class='{4}'>{5}</div>",
/*{0}*/ t.Definition.ToString().Replace('/', '-'),
/*{1}*/ t.Description,
/*{2}*/ t.Definition.Discriminator,
/*{3}*/ t.Name,
/*{4}*/ "definition " + t.Definition.Discriminator,
/*{5}*/ UI.WebControls.ControlPanel.FormatImageAndText(t.Definition.IconUrl, t.Title));
}
}
if (sb.Length > 0)
return "<div class='definitions'>" + sb + "</div>";
}
return "";
}
示例2: GetPreviewUrl
internal static string GetPreviewUrl(this Page page, IEngine engine, ContentItem item)
{
string returnUrl = page.Request["returnUrl"];
if (!string.IsNullOrEmpty(returnUrl))
return Url.Parse(returnUrl).SetQueryParameter(PathData.VersionIndexQueryKey, item.VersionIndex).SetQueryParameter("versionKey", item.GetVersionKey());
return engine.ResolveAdapter<NodeAdapter>(item).GetPreviewUrl(item);
}
示例3: GetNavigationUrl
internal static string GetNavigationUrl(this Page page, IEngine engine, ContentItem item)
{
return engine.ResolveAdapter<NodeAdapter>(item).GetNavigationUrl(item);
}
示例4: GetPreviewUrl
internal static string GetPreviewUrl(this Page page, IEngine engine, ContentItem item)
{
return page.Request["returnUrl"] ?? engine.ResolveAdapter<NodeAdapter>(item).GetPreviewUrl(item);
}