private static bool IsNoOtherVariableReferences([NotNull] IList <IStatement> statements, [NotNull] IBlock block)
        {
            var blockStatements = block.Statements;
            int selectionStart  = blockStatements.IndexOf((ICSharpStatement)statements[0]);

            for (int current = 0; current < statements.Count - 1; current++)
            {
                var declaredVariable = ExtractDeclaredVariableName(statements[current]);

                var nextInvocationTarget = current == statements.Count - 2
          ? FindLastInvocationUse(statements[current + 1], declaredVariable.Name)
          : ExtractInvocationTargetName(statements[current + 1]).NotNull();

                for (int next = selectionStart + current + 1; next < blockStatements.Count; next++)
                {
                    if (IsReferencedExcept(declaredVariable.Name, blockStatements[next], nextInvocationTarget))
                    {
                        return(false);
                    }
                }
            }

            return(true);
        }
        private bool ContainsRethrowStatement(IBlock body)
        {
            var statements = body.Statements;

            return(Enumerable.OfType <IThrowStatement>(statements).Any());
        }