public static Expression GetExpressionTemplate(string name)
{
for (int i = 0, n = ((Namespace)cuExpressions.Nodes[0]).NestedNamespaces[0].Types[0].Members.Count; i < n; i++)
{
Field f = ((Namespace)cuExpressions.Nodes[0]).NestedNamespaces[0].Types[0].Members[i] as Field;
if (f != null && f.Name.Name == name)
{
CS.Duplicator duplicator = new CS.Duplicator(module, null);
duplicator.SkipBodies = false;
Expression expr = duplicator.VisitExpression(f.Initializer);
return expr;
}
}
throw new ArgumentException(string.Format("Expression template '{0}' not found", name));
}