int GetIndexAfterSuperInvocation(Block body)
{
int index = 0;
foreach (Statement s in body.Statements)
{
if (NodeType.ExpressionStatement == s.NodeType)
{
Expression expression = ((ExpressionStatement)s).Expression;
if (NodeType.MethodInvocationExpression == expression.NodeType)
{
if (NodeType.SuperLiteralExpression == ((MethodInvocationExpression)expression).Target.NodeType)
{
return index + 1;
}
}
}
++index;
}
return 0;
}