本文整理汇总了C#中Processor.RenderForDisplay方法的典型用法代码示例。如果您正苦于以下问题:C# Processor.RenderForDisplay方法的具体用法?C# Processor.RenderForDisplay怎么用?C# Processor.RenderForDisplay使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Processor
的用法示例。
在下文中一共展示了Processor.RenderForDisplay方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Processor
void ITagHandler.Process(List<ITemplateAction> actions, MerchantTribeApplication app, ITagProvider tagProvider, ParsedTag tag, string innerContents)
{
string partName = tag.GetSafeAttribute("part");
ThemeManager tm = app.ThemeManager();
string result = tm.GetTemplatePartFromCurrentTheme(partName);
Processor proc = new Processor(app, result, tagProvider);
var subActions = proc.RenderForDisplay();
actions.AddRange(subActions);
}
示例2: Processor
void ITagHandler.Process(StringBuilder output,
MerchantTribeApplication app,
dynamic viewBag,
ITagProvider tagProvider,
ParsedTag tag,
string innerContents)
{
string partName = tag.GetSafeAttribute("part");
ThemeManager tm = app.ThemeManager();
string result = tm.GetTemplatePartFromCurrentTheme(partName);
Processor proc = new Processor(app, viewBag, result, tagProvider);
proc.RenderForDisplay(output);
}
示例3: Process
//.........这里部分代码省略.........
if (innerContents == string.Empty) innerContents = "<span>Checkout</span>";
break;
case "cart":
href = app.CurrentStore.RootUrl() + "cart";
if (innerContents == string.Empty)
{
string itemCount = "0";
string subTotal = "$0.00";
if (SessionManager.CurrentUserHasCart(app.CurrentStore))
{
itemCount = SessionManager.GetCookieString(WebAppSettings.CookieNameCartItemCount(app.CurrentStore.Id), app.CurrentStore);
subTotal = SessionManager.GetCookieString(WebAppSettings.CookieNameCartSubTotal(app.CurrentStore.Id), app.CurrentStore);
if (itemCount.Trim().Length < 1) itemCount = "0";
if (subTotal.Trim().Length < 1) subTotal = "$0.00";
}
innerContents = "<span>View Cart: " + itemCount + " items</span>";
}
break;
case "carttotal":
href = app.CurrentStore.RootUrl() + "cart";
if (innerContents == string.Empty)
{
string subTotal = "$0.00";
if (SessionManager.CurrentUserHasCart(app.CurrentStore))
{
subTotal = SessionManager.GetCookieString(WebAppSettings.CookieNameCartSubTotal(app.CurrentStore.Id), app.CurrentStore);
if (subTotal.Trim().Length < 1) subTotal = "$0.00";
}
innerContents = "<span>" + subTotal + "</span>";
}
break;
case "category":
Category cat = app.CatalogServices.Categories.Find(sysid);
href = app.CurrentStore.RootUrl() + cat.RewriteUrl;
break;
case "product":
Product p = app.CatalogServices.Products.Find(sysid);
href = app.CurrentStore.RootUrl() + p.UrlSlug;
break;
case "":
string temp = tag.GetSafeAttribute("href");
if (temp.StartsWith("http://") || temp.StartsWith("https://"))
{
href = temp;
}
else
{
href = app.CurrentStore.RootUrl() + temp.TrimStart('/');
}
break;
case "myaccount":
href = app.CurrentStore.RootUrlSecure() + "account";
if (innerContents == string.Empty) innerContents = "<span>My Account</span>";
break;
case "signin":
string currentUserId = app.CurrentCustomerId;
if (currentUserId == string.Empty)
{
href = app.CurrentStore.RootUrlSecure() + "signin";
if (innerContents == string.Empty) innerContents = "<span>Sign In</span>";
}
else
{
href = app.CurrentStore.RootUrlSecure() + "signout";
if (innerContents == string.Empty) innerContents = "<span>Sign Out</span>";
}
break;
}
//if (href.Trim().Length > 0)
//{
output.Append("<a href=\"" + href + "\"");
PassAttribute(ref output, tag, "id");
PassAttribute(ref output, tag, "title");
PassAttribute(ref output, tag, "style");
PassAttribute(ref output, tag, "class");
PassAttribute(ref output, tag, "dir");
PassAttribute(ref output, tag, "lang");
PassAttribute(ref output, tag, "target");
PassAttribute(ref output, tag, "rel");
PassAttribute(ref output, tag, "media");
PassAttribute(ref output, tag, "hreflang");
PassAttribute(ref output, tag, "type");
PassAttribute(ref output, tag, "name");
output.Append(">");
// Process any inner tags
Processor proc = new Processor(app, viewBag, innerContents, tagProvider);
proc.RenderForDisplay(output);
output.Append("</a>");
//}
}