public static bool IsIfThrowStatement(this ContractStatement statement)
 {
     return(statement is IfThrowStatement);
 }
        private static bool HasEndContractBlockBeforeCurrentStatement(IList<ProcessedStatement> contractBlock, ContractStatement currentStatement)
        {
            foreach (var c in contractBlock)
            {
                if (c.ContractStatement != null && c.ContractStatement.Equals(currentStatement))
                    return false;

                if (c.CodeContractStatement != null && 
                    c.CodeContractStatement.StatementType == CodeContractStatementType.EndContractBlock)
                    return true;
            }

            Contract.Assert(false, "Current statement not found in the contract block");
            throw new InvalidOperationException("Current statement not found in the contract block");
        }