本文整理汇总了C#中MerchantTribeApplication.ThemeManager方法的典型用法代码示例。如果您正苦于以下问题:C# MerchantTribeApplication.ThemeManager方法的具体用法?C# MerchantTribeApplication.ThemeManager怎么用?C# MerchantTribeApplication.ThemeManager使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MerchantTribeApplication
的用法示例。
在下文中一共展示了MerchantTribeApplication.ThemeManager方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Process
public string Process(MerchantTribeApplication app, Dictionary<string, ITagHandler> handlers, ParsedTag tag, string contents)
{
string fileUrl = string.Empty;
bool secure = app.CurrentRequestContext.RoutingContext.HttpContext.Request.IsSecureConnection;
ThemeManager tm = app.ThemeManager();
string mode = tag.GetSafeAttribute("mode");
if (mode == "legacy")
{
fileUrl = tm.CurrentStyleSheet(app, secure);
}
else if (mode == "system")
{
string cssFile = tag.GetSafeAttribute("file");
fileUrl = app.StoreUrl(secure, false) + cssFile.TrimStart('/');
}
else
{
string fileName = tag.GetSafeAttribute("file");
fileUrl = tm.ThemeFileUrl(fileName, app);
}
string result = string.Empty;
result = "<link href=\"" + fileUrl + "\" rel=\"stylesheet\" type=\"text/css\" />";
return result;
}
示例2: Process
public string Process(MerchantTribeApplication app, Dictionary<string, ITagHandler> handlers, ParsedTag tag, string contents)
{
StringBuilder sb = new StringBuilder();
bool secure = app.CurrentRequestContext.RoutingContext.HttpContext.Request.IsSecureConnection;
string mode = tag.GetSafeAttribute("mode");
if (mode == "system")
{
string baseScriptFolder = app.CurrentStore.RootUrl();
if (secure) baseScriptFolder = app.CurrentStore.RootUrlSecure();
if (baseScriptFolder.EndsWith("/") == false)
{
baseScriptFolder += "/";
}
baseScriptFolder += "scripts/";
bool useCDN = false;
string cdn = tag.GetSafeAttribute("cdn");
if (cdn == "1" || cdn == "true" || cdn == "y" || cdn == "Y") useCDN = true;
if (useCDN)
{
// CDN JQuery
if (secure)
{
sb.Append("<script src='https://ajax.microsoft.com/ajax/jQuery/jquery-1.5.1.min.js' type=\"text/javascript\"></script>");
}
else
{
sb.Append("<script src='http://ajax.microsoft.com/ajax/jQuery/jquery-1.5.1.min.js' type=\"text/javascript\"></script>");
}
}
else
{
// Local JQuery
sb.Append("<script src='" + baseScriptFolder + "jquery-1.5.1.min.js' type=\"text/javascript\"></script>");
}
sb.Append(System.Environment.NewLine);
sb.Append("<script src='" + baseScriptFolder + "jquery-ui-1.8.7.custom/js/jquery-ui-1.8.7.custom.min.js' type=\"text/javascript\"></script>");
sb.Append("<script src='" + baseScriptFolder + "jquery.form.js' type=\"text/javascript\"></script>");
sb.Append(System.Environment.NewLine);
}
else
{
string src = tag.GetSafeAttribute("src");
string fileName = tag.GetSafeAttribute("file");
if (fileName.Trim().Length > 0)
{
ThemeManager tm = app.ThemeManager();
src = tm.ThemeFileUrl(fileName, app);
}
sb.Append("<script src=\"" + src + "\" type=\"text/javascript\"></script>");
}
return sb.ToString();
}
示例3: Process
public string Process(MerchantTribeApplication app, Dictionary<string, ITagHandler> handlers, ParsedTag tag, string contents)
{
string partName = tag.GetSafeAttribute("part");
ThemeManager tm = app.ThemeManager();
string result = tm.GetTemplatePartFromCurrentTheme(partName);
TemplateProcessor proc = new TemplateProcessor(app, result, handlers);
string processed = proc.RenderForDisplay();
return processed;
}
示例4: Process
public string Process(MerchantTribeApplication app, Dictionary<string, ITagHandler> handlers, ParsedTag tag, string contents)
{
StringBuilder sb = new StringBuilder();
string rootUrl = app.StoreUrl(false, true);
string buttonUrl = app.ThemeManager().ButtonUrl("Go", app.CurrentRequestContext.RoutingContext.HttpContext.Request.IsSecureConnection);
sb.Append("<form class=\"searchform\" action=\"" + rootUrl + "search\" method=\"get\">");
sb.Append("<input type=\"text\" name=\"q\" class=\"searchinput\" /> <input class=\"searchgo\" type=\"image\" src=\"" + buttonUrl + "\" alt=\"Search\" />");
sb.Append("</form>");
return sb.ToString();
}