本文整理汇总了C#中MerchantTribe.StoreUrl方法的典型用法代码示例。如果您正苦于以下问题:C# MerchantTribe.StoreUrl方法的具体用法?C# MerchantTribe.StoreUrl怎么用?C# MerchantTribe.StoreUrl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MerchantTribe
的用法示例。
在下文中一共展示了MerchantTribe.StoreUrl方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Process
public void Process(List<ITemplateAction> actions, MerchantTribe.Commerce.MerchantTribeApplication app, ITagProvider tagProvider, ParsedTag tag, string innerContents)
{
string fileUrl = string.Empty;
bool secure = app.CurrentRequestContext.RoutingContext.HttpContext.Request.IsSecureConnection;
var 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\" />";
actions.Add(new Actions.LiteralText(result));
}
示例2: Process
public void Process(List<ITemplateAction> actions, MerchantTribe.Commerce.MerchantTribeApplication app, ITagProvider tagProvider, ParsedTag tag, string innerContents)
{
SearchFormViewModel model = new SearchFormViewModel();
string rootUrl = app.StoreUrl(false, true);
model.SearchFormUrl = rootUrl + "search";
model.ButtonImageUrl = app.ThemeManager().ButtonUrl("Go", app.CurrentRequestContext.RoutingContext.HttpContext.Request.IsSecureConnection);
actions.Add(new Actions.PartialView("~/views/shared/_SearchForm.cshtml", model));
}
示例3: Process
public void Process(StringBuilder output,
MerchantTribe.Commerce.MerchantTribeApplication app,
dynamic viewBag,
ITagProvider tagProvider,
ParsedTag tag,
string innerContents)
{
SearchFormViewModel model = new SearchFormViewModel();
string rootUrl = app.StoreUrl(false, true);
model.SearchFormUrl = rootUrl + "search";
model.ButtonImageUrl = app.ThemeManager().ButtonUrl("Go", app.IsCurrentRequestSecure());
Render(output, model);
}
示例4: Process
public void Process(StringBuilder output,
MerchantTribe.Commerce.MerchantTribeApplication app,
dynamic viewBag,
ITagProvider tagProvider,
ParsedTag tag,
string innerContents)
{
string fileUrl = string.Empty;
bool secure = app.IsCurrentRequestSecure();
var 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);
}
if (fileUrl.StartsWith("http://"))
{
fileUrl = fileUrl.Replace("http://", "//");
}
string result = string.Empty;
result = "<link href=\"" + fileUrl + "\" rel=\"stylesheet\" type=\"text/css\" />";
output.Append(result);
}
示例5: CheckFor301
private void CheckFor301(string slug, MerchantTribe.Commerce.MerchantTribeApplication app)
{
MerchantTribe.Commerce.Content.CustomUrl url = app.ContentServices.CustomUrls.FindByRequestedUrl(slug);
if (url != null)
{
if (url.Bvin != string.Empty)
{
string destination = app.StoreUrl(false, false) + url.RedirectToUrl.TrimStart('/');
if (url.IsPermanentRedirect)
{
app.CurrentRequestContext.RoutingContext.HttpContext.Response.RedirectPermanent(destination);
}
else
{
app.CurrentRequestContext.RoutingContext.HttpContext.Response.Redirect(destination);
}
}
}
}