public void BasicUsage() { Styler styler = new Styler(); styler.RuleSet = RuleSets.CSharp; styler.StyleTemplate = DefaultStyles.CSharpHtmlLine; string styledCode = styler.StyleCode( @"// This is comment. /// /// <summary>Something ""text"".</summary> /// #region #endregion if (splitterCharIndex < 0 && line.Length > 0) // comment again { string s = @""Hello World""; throw new BadRuleException( string.Format(""No splitter found at {0}."", lineCount)); }"); Console.WriteLine(styledCode); }
private string FormatCode(RuleSet ruleSet, IAtTemplate template, string code) { Styler styler = new Styler() { RuleSet = ruleSet, StyleTemplate = template }; return styler.StyleCode(code); }
public void String_Within_Comment() { Styler styler = new Styler(); styler.RuleSet = RuleSets.CSharp; styler.StyleTemplate = DefaultStyles.CSharpHtml; string styledCode = styler.StyleCode( @"// ""hello"""); Console.WriteLine(styledCode); }