标签:tar mina lang ase however loading following author during
August 12, 2008 at 11:22 AM — Amer Gerzic
Couple of days ago, my blog application started crushing. At first, I assumed that my ISP provider is to blame. Somewhat irritated I submitted the question to the support crew and couple of emails later, they informed me that the blog application was taking over 100MB in RAM space (which triggers the server to stop the application). In addition I noticed that the number of visitors increased dramatically over the last couple of weeks. Quick look under the hood revealed that during post rendering, source code is rendered "on-fly", which utilizes Wilco.SyntaxHighlighter.dll control. Considering the fact that there are many posts that display the source code and that there are many visitors viewing them, it is possible that memory usage would increase drastically. To eliminate the issue I decided to render the code at the time of post editing (as opposed to rendering during page loading). The only elegant solution (in my case) was to use Windows Live Writer with source code plugin. However, I could not find a plugin that would satisfy my needs, so I decided to write my own.
As mentioned earlier, all of my syntax highlighting is done by Wilco.SyntaxHighlighting.dll control which can be found under reference section. At the same site you can find the source code. Following languages are supported:
Simplest code formatting - no box, no line numbers, no alternating color lines:
public class SourceCodeFormatter{/* Member 1 */public static string member1;/* Member 2 */private int member2;// Constructorpublic SourceCodeFormatter(){}}
... now enclose code into a box - very useful if the code might "overflow"
public class SourceCodeFormatter{/* Member 1 */public static string member1;/* Member 2 */private int member2;// Constructorpublic SourceCodeFormatter(){}}
... now add line numbers and alternating line coloring:
1: public class SourceCodeFormatter2: {3: /* Member 1 */4: public static string member1;5:6: /* Member 2 */7: private int member2;8:9: // Constructor10: public SourceCodeFormatter()11: {12: }13: }
... now we can select some lines for demonstration:
1: public class SourceCodeFormatter2: {3: /* Member 1 */4: public static string member1;5:6: /* Member 2 */7: private int member2;8:9: // Constructor10: public SourceCodeFormatter()11: {12: }13: }
标签:tar mina lang ase however loading following author during
原文地址:https://www.cnblogs.com/superdesigns/p/9807563.html