Ejemplo n.º 1
0
        /// <summary>
        /// Copy initializes a new instance of the <see cref="StatementASTWalker"/> class.
        /// </summary>
        /// <param name="other"></param>
        /// <remarks>
        /// For testability.
        /// </remarks>
        public StatementASTWalker(StatementASTWalker other)
        {
            if (other == null)
            {
                throw new ArgumentNullException(nameof(other));
            }

            this.node          = other.node;
            this.semanticModel = other.semanticModel;
            this.statement     = other.statement;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="StatementASTWalker"/> class.
        /// </summary>
        /// <param name="node"></param>
        protected StatementASTWalker(CSharpSyntaxNode node, SemanticModel semanticModel)
        {
            var statementSyntaxNode = node as StatementSyntax;

            if (statementSyntaxNode == null)
            {
                throw new ArgumentException(
                          string.Format("Specified node is not of type {0}",
                                        typeof(StatementSyntax).Name));
            }

            this.node          = node;
            this.semanticModel = semanticModel;
            this.statement     = null;
        }