Пример #1
0
        public void CommentSyntaxTest()
        {
            string     comment = @"        /// <summary>
        /// A method that takes a string and returns a string.
        /// </summary>
        /// <param name=""aValue"">Any string value</param>
        /// <returns>The value passed in.</returns>";
            SyntaxTree tree    = CSharpSyntaxTree.ParseText(comment);
            CSharpDocumentationSyntaxWalker walker = new CSharpDocumentationSyntaxWalker();

            walker.Visit(tree.GetRoot());
        }
Пример #2
0
        public void CodeAnalysisExperiment()
        {
            SyntaxTree tree = CSharpSyntaxTree.ParseText(@"using System;
using System.Collections;
using System.Linq;
using System.Text;
 

/// This is stuff for the namespace
///
///
namespace HelloWorld
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine(""Hello, World!"");
        }

        /// <summary>
        /// A method that takes a string and returns a string.
        /// </summary>
        /// <param name=""aValue"">Any string value</param>
        /// <returns>The value passed in.</returns>
        public void MyDocumentedMethod(string aValue)
        {

        }

        public void MyUndocumentedMethod(string s, string d)
        {
        }
    }
}");
            CSharpDocumentationSyntaxWalker walker = new CSharpDocumentationSyntaxWalker();

            walker.Visit(tree.GetRoot());
        }