public static StatementList GetStatementsTemplate(string name)
{
for (int i = 0, n = ((Namespace)cuStatements.Nodes[0]).NestedNamespaces[0].Types[0].Members.Count; i < n; i++)
{
Method m = ((Namespace)cuStatements.Nodes[0]).NestedNamespaces[0].Types[0].Members[i] as Method;
if (m != null && m.Name.Name == name)
{
CS.Duplicator duplicator = new CS.Duplicator(module, null);
duplicator.SkipBodies = false;
return duplicator.VisitStatementList(m.Body.Statements);
}
}
throw new ArgumentException(string.Format("Statement template '{0}' not found", name));
}