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


C# Template.ParseRaw方法代码示例

本文整理汇总了C#中Template.ParseRaw方法的典型用法代码示例。如果您正苦于以下问题:C# Template.ParseRaw方法的具体用法?C# Template.ParseRaw怎么用?C# Template.ParseRaw使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Template的用法示例。


在下文中一共展示了Template.ParseRaw方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DisplayGenericError

 /// <summary>
 /// Renders an error to the account panel.
 /// </summary>
 /// <param name="errorMessage"></param>
 protected void DisplayGenericError()
 {
     template = new Template(core.Http.TemplatePath, "1302.html");
     template.ParseRaw("ERROR_MESSAGE", "An error has occured accessing this account module, maybe you are accessing it incorrectly. <a href=\"javascript:history.go(-1);\">Go Back</a>");
     RenderTemplate();
 }
开发者ID:smithydll,项目名称:boxsocial,代码行数:10,代码来源:ControlPanelSubModule.cs

示例2: ParseACL


//.........这里部分代码省略.........

                            allowrl.Add(new RadioListItem(allowrl.Name, "allow", "Allow"));
                            allowrl.Add(new RadioListItem(allowrl.Name, "deny", "Deny"));
                            allowrl.Add(new RadioListItem(allowrl.Name, "inherit", "Inherit"));

                            allowsb.Add(new SelectBoxItem("allow", "Allow"));
                            allowsb.Add(new SelectBoxItem("deny", "Deny"));
                            allowsb.Add(new SelectBoxItem("inherit", "Inherit"));

                            switch (uacg.Allow)
                            {
                                case AccessControlGrants.Allow:
                                    allowrl.SelectedKey = "allow";
                                    allowsb.SelectedKey = "allow";
                                    break;
                                case AccessControlGrants.Deny:
                                    allowrl.SelectedKey = "deny";
                                    allowsb.SelectedKey = "deny";
                                    break;
                                case AccessControlGrants.Inherit:
                                    allowrl.SelectedKey = "inherit";
                                    allowsb.SelectedKey = "inherit";
                                    break;
                            }

                            grantVariableCollection.Parse("S_GRANT", allowsb);

                            grantVariableCollection.Parse("S_ALLOW", allowrl["allow"]);
                            grantVariableCollection.Parse("S_DENY", allowrl["deny"]);
                            grantVariableCollection.Parse("S_INHERIT", allowrl["inherit"]);

                            grantVariableCollection.Parse("ID", string.Format("{0},{1}", ik.TypeId, ik.Id));
                            grantVariableCollection.Parse("PERMISSION_ID", itemPermission.Id.ToString());
                            grantVariableCollection.Parse("IS_NEW", "TRUE");

                            groupsSelectBox[groupSelectBoxId].Selectable = false;
                        }

                        permissionVariableCollection.Parse("S_PERMISSION_GROUPS", groupsSelectBox);

                        RadioList allowNewrl = new RadioList("new-permission-group-allow");
                        SelectBox allowNewsb = new SelectBox("new-permission-group-allow");

                        allowNewrl.Add(new RadioListItem(allowNewrl.Name, "allow", "Allow"));
                        allowNewrl.Add(new RadioListItem(allowNewrl.Name, "deny", "Deny"));
                        allowNewrl.Add(new RadioListItem(allowNewrl.Name, "inherit", "Inherit"));

                        allowNewsb.Add(new SelectBoxItem("allow", "Allow"));
                        allowNewsb.Add(new SelectBoxItem("deny", "Deny"));
                        allowNewsb.Add(new SelectBoxItem("inherit", "Inherit"));

                        allowNewrl.SelectedKey = "inherit";
                        allowNewsb.SelectedKey = "inherit";

                        permissionVariableCollection.Parse("S_GRANT", allowNewsb);

                        permissionVariableCollection.Parse("S_ALLOW", allowNewrl["allow"].ToString());
                        permissionVariableCollection.Parse("S_DENY", allowNewrl["deny"].ToString());
                        permissionVariableCollection.Parse("S_INHERIT", allowNewrl["inherit"].ToString());
                    }
                }

                if (typeGroupSelectBox != null)
                {
                    permissionTypeVariableCollection.Parse("S_SIMPLE_SELECT", typeGroupSelectBox);
                }
            }

            if (string.IsNullOrEmpty(variable))
            {
                variable = "S_PERMISSIONS";
            }

            /*PermissionGroupSelectBox groupSelectBox = new PermissionGroupSelectBox(core, "group-select", item.ItemKey);
            groupSelectBox.SelectMultiple = true;

            aclTemplate.Parse("S_SIMPLE_SELECT", groupSelectBox);*/

            if (simple)
            {
                aclTemplate.Parse("IS_SIMPLE", "TRUE");
            }

            aclTemplate.Parse("U_DETAILED", Access.BuildAclUri(core, item, false));
            aclTemplate.Parse("U_SIMPLE", Access.BuildAclUri(core, item, true));

            HiddenField modeField = new HiddenField("aclmode");
            if (simple)
            {
                modeField.Value = "simple";
            }
            else
            {
                modeField.Value = "detailed";
            }

            aclTemplate.Parse("S_ACLMODE", modeField);

            template.ParseRaw(variable, aclTemplate.ToString());
        }
开发者ID:smithydll,项目名称:boxsocial,代码行数:101,代码来源:AccessControlLists.cs

示例3: ParseLicensingBox

 public void ParseLicensingBox(Template template, string templateVar, byte selectedLicense)
 {
     template.ParseRaw(templateVar, ContentLicense.BuildLicenseSelectBox(core.Db, selectedLicense));
 }
开发者ID:smithydll,项目名称:boxsocial,代码行数:4,代码来源:Display.cs

示例4: ParseMinimalPagination

 public void ParseMinimalPagination(Template template, string templateVar, string baseUri, int pageLevel, int itemsPerPage, long totalItems)
 {
     int maxPages = (int)Math.Ceiling(totalItems / (double)itemsPerPage);
     template.ParseRaw(templateVar, GeneratePagination(baseUri, pageLevel, core.PageNumber, core.PageOffset, maxPages, PaginationOptions.Minimal));
 }
开发者ID:smithydll,项目名称:boxsocial,代码行数:5,代码来源:Display.cs

示例5: ParseBreadCrumbs

 public void ParseBreadCrumbs(Template template, string templateVar, List<string[]> parts)
 {
     template.ParseRaw(templateVar, GenerateBreadCrumbs(parts));
 }
开发者ID:smithydll,项目名称:boxsocial,代码行数:4,代码来源:Display.cs

示例6: ParseClassification

 public void ParseClassification(Template template, string templateVar, Classifications classification)
 {
     template.ParseRaw(templateVar, Classification.BuildClassificationBox(core, classification));
 }
开发者ID:smithydll,项目名称:boxsocial,代码行数:4,代码来源:Display.cs

示例7: ParseBbcode

 public void ParseBbcode(Template template, string templateVar, string input, Primitive owner, bool appendP, string id, string styleClass, bool fullInternalUrls)
 {
     if (owner != null)
     {
         template.ParseRaw(templateVar, core.Bbcode.Parse(HttpUtility.HtmlEncode(input), core.Session.LoggedInMember, owner, appendP, id, styleClass, fullInternalUrls));
     }
     else
     {
         template.ParseRaw(templateVar, core.Bbcode.Parse(HttpUtility.HtmlEncode(input), core.Session.LoggedInMember, appendP, id, styleClass, fullInternalUrls));
     }
 }
开发者ID:smithydll,项目名称:boxsocial,代码行数:11,代码来源:Display.cs

示例8: ParseBlogPagination

 // Blog
 public void ParseBlogPagination(Template template, string templateVar, string baseUri, int pageLevel, long offsetItemId)
 {
     template.ParseRaw(templateVar, GenerateBlogPagination(baseUri, pageLevel, core.PageNumber, core.PageOffset, offsetItemId));
 }
开发者ID:smithydll,项目名称:boxsocial,代码行数:5,代码来源:Display.cs

示例9: ParseSelectBox

 public void ParseSelectBox(Template template, string templateVar, string name, List<SelectBoxItem> items, string selectedItem, List<string> disabledItems)
 {
     template.ParseRaw(templateVar, Functions.BuildSelectBox(name, items, selectedItem, disabledItems));
 }
开发者ID:smithydll,项目名称:boxsocial,代码行数:4,代码来源:Display.cs

示例10: ParseRadioArray

 public void ParseRadioArray(Template template, string templateVar, string name, int columns, List<SelectBoxItem> items, string selectedItem, List<string> disabledItems)
 {
     template.ParseRaw(templateVar, Functions.BuildRadioArray(name, columns, items, selectedItem, disabledItems));
 }
开发者ID:smithydll,项目名称:boxsocial,代码行数:4,代码来源:Display.cs

示例11: ParsePagination

 public void ParsePagination(Template template, string templateVar, string baseUri, int pageLevel, int itemsPerPage, long totalItems, bool minimal)
 {
     int maxPages = (int)Math.Ceiling(totalItems / (double)itemsPerPage);
     template.ParseRaw(templateVar, GeneratePagination(baseUri, pageLevel, core.PageNumber, core.PageOffset, maxPages, (minimal ? PaginationOptions.Minimal : PaginationOptions.Normal)));
     if (maxPages > 1)
     {
         template.Parse(templateVar + "_MORE", "TRUE");
     }
 }
开发者ID:smithydll,项目名称:boxsocial,代码行数:9,代码来源:Display.cs

示例12: ParsePageList

 public void ParsePageList(Template template, string templateVar, Primitive owner, bool fragment, Page current)
 {
     template.ParseRaw(templateVar, GeneratePageList(owner, core.Session.LoggedInMember, fragment, current));
 }
开发者ID:smithydll,项目名称:boxsocial,代码行数:4,代码来源:Display.cs

示例13: ParseCoreBreadCrumbs

        public void ParseCoreBreadCrumbs(Template template, string templateVar, List<string[]> parts)
        {
            string output = string.Empty;
            string path = "/";
            output = string.Format("<a href=\"{1}\">{0}</a>",
                    core.Settings.SiteTitle, core.Hyperlink.AppendSid(path));

            for (int i = 0; i < parts.Count; i++)
            {
                if (parts[i][0] != "")
                {
                    output += string.Format(" <strong>&#8249;</strong> <a href=\"{1}\">{0}</a>",
                        parts[i][1], core.Hyperlink.AppendSid(path + parts[i][0].TrimStart(new char[] { '*' })));
                    if (!parts[i][0].StartsWith("*", StringComparison.Ordinal))
                    {
                        path += parts[i][0] + "/";
                    }
                }
            }

            template.ParseRaw(templateVar, output);
        }
开发者ID:smithydll,项目名称:boxsocial,代码行数:22,代码来源:TPage.cs


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