本文整理汇总了C#中MerchantTribeApplication.IsCurrentRequestSecure方法的典型用法代码示例。如果您正苦于以下问题:C# MerchantTribeApplication.IsCurrentRequestSecure方法的具体用法?C# MerchantTribeApplication.IsCurrentRequestSecure怎么用?C# MerchantTribeApplication.IsCurrentRequestSecure使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MerchantTribeApplication
的用法示例。
在下文中一共展示了MerchantTribeApplication.IsCurrentRequestSecure方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GenerateSwatchHtmlForProduct
public static string GenerateSwatchHtmlForProduct(Catalog.Product p, MerchantTribeApplication app)
{
string result = string.Empty;
if (app.CurrentStore.Settings.ProductEnableSwatches == false) return result;
if (p.Options.Count > 0)
{
bool found = false;
string swatchBase = MerchantTribe.Commerce.Storage.DiskStorage.BaseUrlForSingleStore(app, app.IsCurrentRequestSecure());
swatchBase += "swatches";
string swatchPhysicalBase = MerchantTribe.Commerce.Storage.DiskStorage.BaseStorePhysicalPath(app.CurrentStore.Id);
swatchPhysicalBase += "swatches\\";
StringBuilder sb = new StringBuilder();
sb.Append("<div class=\"productswatches\">");
foreach (var opt in p.Options)
{
if (opt.Name.Trim().ToUpperInvariant() == "COLOR" ||
opt.Name.Trim().ToUpperInvariant() == "COLOR:")
{
found = true;
foreach (var oi in opt.Items)
{
if (oi.IsLabel) continue;
string prefix = CleanSwatchName(oi.Name);
if (File.Exists(swatchPhysicalBase + prefix + ".png"))
{
sb.Append("<img width=\"18\" height=\"18\" src=\"" + swatchBase + "/" + prefix + ".png\" border=\"0\" alt=\"" + prefix + "\" />");
}
else
{
sb.Append("<img width=\"18\" height=\"18\" src=\"" + swatchBase + "/" + prefix + ".gif\" border=\"0\" alt=\"" + prefix + "\" />");
}
}
}
}
sb.Append("</div>");
if (found == true)
{
result = sb.ToString();
}
}
return result;
}
示例2: ReplaceContentTags
public static string ReplaceContentTags(string source, MerchantTribeApplication app, string itemCount)
{
var profiler = MiniProfiler.Current;
using (profiler.Step("Tag Replacer"))
{
if (source.Contains("{{"))
{
bool isSecureRequest = app.IsCurrentRequestSecure();
Accounts.Store currentStore = app.CurrentStore;
string currentUserId = app.CurrentCustomerId;
string output = source;
RouteCollection r = System.Web.Routing.RouteTable.Routes;
output = output.Replace("{{homelink}}", app.StoreUrl(isSecureRequest, false));
output = output.Replace("{{logo}}", HtmlRendering.Logo(app, isSecureRequest));
output = output.Replace("{{logotext}}", HtmlRendering.LogoText(app));
output = output.Replace("{{headermenu}}", HtmlRendering.HeaderMenu(app));
output = output.Replace("{{cartlink}}", HtmlRendering.CartLink(app, itemCount));
output = output.Replace("{{copyright}}", "<span class=\"copyright\">Copyright ©" + DateTime.Now.Year.ToString() + "</span>");
output = output.Replace("{{headerlinks}}", HtmlRendering.HeaderLinks(app, currentUserId));
output = output.Replace("{{searchform}}", HtmlRendering.SearchForm(app));
output = output.Replace("{{assets}}", MerchantTribe.Commerce.Storage.DiskStorage.BaseUrlForStoreTheme(app, currentStore.Settings.ThemeId, isSecureRequest) + "assets/");
output = output.Replace("{{img}}", MerchantTribe.Commerce.Storage.DiskStorage.StoreAssetUrl(app, string.Empty, isSecureRequest));
output = output.Replace("{{storeassets}}", MerchantTribe.Commerce.Storage.DiskStorage.StoreAssetUrl(app, string.Empty, isSecureRequest));
output = output.Replace("{{sitefiles}}", MerchantTribe.Commerce.Storage.DiskStorage.BaseUrlForSingleStore(app, isSecureRequest));
output = output.Replace("{{storeaddress}}", app.ContactServices.Addresses.FindStoreContactAddress().ToHtmlString());
return output;
}
else
{
return source;
}
}
}