public override void VisitLockStatement(LockStatementSyntax node) { var lockBinder = new LockBinder(_enclosing, node); AddToMap(node, lockBinder); StatementSyntax statement = node.Statement; var statementBinder = lockBinder.WithAdditionalFlags(BinderFlags.InLockBody); if (statementBinder != lockBinder) { AddToMap(statement, statementBinder); } VisitPossibleEmbeddedStatement(statement, statementBinder); }
public override void VisitLockStatement(LockStatementSyntax node) { var patternBinder = new PatternVariableBinder(node, _enclosing); var lockBinder = new LockBinder(patternBinder, node); AddToMap(node, lockBinder); Visit(node.Expression, lockBinder); StatementSyntax statement = node.Statement; var statementBinder = lockBinder.WithAdditionalFlags(BinderFlags.InLockBody); if (statementBinder != lockBinder) { AddToMap(statement, statementBinder); } VisitPossibleEmbeddedStatement(statement, statementBinder); }