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

            return styler.StyleCode(code);
        }
Пример #3
0
        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);
        }