当前位置: 首页>>代码示例>>C#>>正文


C# MerchantTribe.StoreUrl方法代码示例

本文整理汇总了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));
        }
开发者ID:NightOwl888,项目名称:MerchantTribe,代码行数:27,代码来源:Css.cs

示例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));
        }
开发者ID:NightOwl888,项目名称:MerchantTribe,代码行数:9,代码来源:SearchForm.cs

示例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);            
        }
开发者ID:appliedi,项目名称:MerchantTribe,代码行数:14,代码来源:SearchForm.cs

示例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);            
        }
开发者ID:appliedi,项目名称:MerchantTribe,代码行数:36,代码来源:Css.cs

示例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);
                    }
                }
            }
        }
开发者ID:mcastells,项目名称:MerchantTribe,代码行数:20,代码来源:CustomRouter.cs


注:本文中的MerchantTribe.StoreUrl方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。