Example #1
0
        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);
        }
Example #2
0
        private string FormatCode(RuleSet ruleSet, IAtTemplate template, string code)
        {
            Styler styler = new Styler()
            {
                RuleSet = ruleSet,
                StyleTemplate = template
            };

            return styler.StyleCode(code);
        }
Example #3
0
        public void Comment_Within_String()
        {
            Styler styler = new Styler();

            styler.RuleSet = RuleSets.CSharp;
            styler.StyleTemplate = DefaultStyles.CSharpHtml;

            string styledCode = styler.StyleCode(
            @"""hello//dsd""");

            Console.WriteLine(styledCode);
        }