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


C# Processor.RenderForDisplay方法代码示例

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

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

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


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