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


C# Misc.appendToKey方法代码示例

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


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

示例1: requestEnd

 public static void requestEnd(string pluginid, Connector conn, ref Misc.PageElements pageElements, HttpRequest request, HttpResponse response)
 {
     bool cookiesEnabled = request.Cookies["cookie-control"] != null;
     // Add styling and toggle button
     Misc.Plugins.addHeaderCSS(pageElements["URL"] + "/Content/CSS/CookieControl.css", ref pageElements);
     Misc.Plugins.addHeaderJS(pageElements["URL"] + "/Content/JS/CookieControl.js", ref pageElements);
     // Add toggle button
     pageElements.appendToKey("BODY_FOOTER", Core.templates["cookiecontrol"]["toggle"]);
     // Add warning banner
     if (!cookiesEnabled)
         pageElements.appendToKey("BODY_HEADER", Core.templates["cookiecontrol"]["banner"]);
     else
     {
         // Check if cookies have been enabled, if so return - no need to remove cookies
         pageElements.setFlag("COOKIES_ON");
         return;
     }
     // Clear all the response cookies - these may have been added programmatically
     response.Cookies.Clear();
     // Add each cookie, sent in the request, in the response - to expire
     HttpCookie cookie;
     for (int i = 0; i < request.Cookies.Count; i++)
     {
         cookie = request.Cookies[i];
         if (cookie.Name != "ASP.NET_SessionId")
         {
             cookie.Expires = DateTime.Now.AddDays(-2);
             response.Cookies.Add(cookie);
         }
     }
 }
开发者ID:kassemshehady,项目名称:Uber-CMS,代码行数:31,代码来源:Base.cs

示例2: formatIncludes

 /// <summary>
 /// This is required to insert the required dependencies for formatted pages; this is only needed for e.g. cached or preview documents.
 /// </summary>
 public static void formatIncludes(HttpRequest request, HttpResponse response, Connector connector, ref Misc.PageElements pageElements, bool formattingText, bool formattingObjects)
 {
     if(formattingText || formattingObjects)
         Misc.Plugins.addHeaderCssOnce(pageElements["URL"] + "/Content/CSS/Common.css", ref pageElements);
     if (formattingObjects)
     {
         // Code syntax highlighter: base
         Misc.Plugins.addHeaderJsOnce(pageElements["URL"] + "/Content/JS/Common/shCore.js", ref pageElements);
         Misc.Plugins.addHeaderCssOnce(pageElements["URL"] + "/Content/CSS/Common/shCore.css", ref pageElements);
         Misc.Plugins.addHeaderCssOnce(pageElements["URL"] + "/Content/CSS/Common/shThemeDefault.css", ref pageElements);
         // Code syntax highlighter: languages - admittedly this is heavy...
         Misc.Plugins.addHeaderJsOnce(pageElements["URL"] + "/Content/JS/Common/shBrushAS3.js", ref pageElements);
         Misc.Plugins.addHeaderJsOnce(pageElements["URL"] + "/Content/JS/Common/shBrushBash.js", ref pageElements);
         Misc.Plugins.addHeaderJsOnce(pageElements["URL"] + "/Content/JS/Common/shBrushColdFusion.js", ref pageElements);
         Misc.Plugins.addHeaderJsOnce(pageElements["URL"] + "/Content/JS/Common/shBrushCpp.js", ref pageElements);
         Misc.Plugins.addHeaderJsOnce(pageElements["URL"] + "/Content/JS/Common/shBrushCSharp.js", ref pageElements);
         Misc.Plugins.addHeaderJsOnce(pageElements["URL"] + "/Content/JS/Common/shBrushCss.js", ref pageElements);
         Misc.Plugins.addHeaderJsOnce(pageElements["URL"] + "/Content/JS/Common/shBrushDelphi.js", ref pageElements);
         Misc.Plugins.addHeaderJsOnce(pageElements["URL"] + "/Content/JS/Common/shBrushJava.js", ref pageElements);
         Misc.Plugins.addHeaderJsOnce(pageElements["URL"] + "/Content/JS/Common/shBrushJScript.js", ref pageElements);
         Misc.Plugins.addHeaderJsOnce(pageElements["URL"] + "/Content/JS/Common/shBrushPerl.js", ref pageElements);
         Misc.Plugins.addHeaderJsOnce(pageElements["URL"] + "/Content/JS/Common/shBrushPhp.js", ref pageElements);
         Misc.Plugins.addHeaderJsOnce(pageElements["URL"] + "/Content/JS/Common/shBrushPowerShell.js", ref pageElements);
         Misc.Plugins.addHeaderJsOnce(pageElements["URL"] + "/Content/JS/Common/shBrushPython.js", ref pageElements);
         Misc.Plugins.addHeaderJsOnce(pageElements["URL"] + "/Content/JS/Common/shBrushRuby.js", ref pageElements);
         Misc.Plugins.addHeaderJsOnce(pageElements["URL"] + "/Content/JS/Common/shBrushScala.js", ref pageElements);
         Misc.Plugins.addHeaderJsOnce(pageElements["URL"] + "/Content/JS/Common/shBrushSql.js", ref pageElements);
         Misc.Plugins.addHeaderJsOnce(pageElements["URL"] + "/Content/JS/Common/shBrushVb.js", ref pageElements);
         Misc.Plugins.addHeaderJsOnce(pageElements["URL"] + "/Content/JS/Common/shBrushXml.js", ref pageElements);
         Misc.Plugins.addHeaderJsOnce(pageElements["URL"] + "/Content/JS/Common/shBrushPlain.js", ref pageElements);
         pageElements.appendToKey("BODY_FOOTER", "<script type=\"text/javascript\">SyntaxHighlighter.all()</script>");
     }
 }
开发者ID:kassemshehady,项目名称:Uber-CMS,代码行数:36,代码来源:Common.cs


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