/// <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; }
/// <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; }