public void Generate(IndentedTextWriter writer, string className, bool isStatic)
{
foreach (GenSpec spec in genSpecs)
{
if (spec.ClassName == className)
{
if (currentRegion == null)
{
//currentRegion = spec.LeftPart;
//int dot = currentRegion.IndexOf('.');
//if (dot > 0) currentRegion = currentRegion.Substring(dot + 1);
currentRegion = spec.MethodName;
int lpar = currentRegion.IndexOf('(');
if (lpar > 0) currentRegion = currentRegion.Substring(0, lpar);
writer.WriteLine("#region " + currentRegion);
writer.WriteLine();
}
if (spec.IsGeneric)
writer.WriteLineNoTabs("#if NET_2_0");
if (spec.ClassName == "Assert")
GenerateAssertOverloads(writer, isStatic, spec);
else
GenerateMethod(writer, isStatic, spec);
if (spec.IsGeneric)
writer.WriteLineNoTabs("#endif");
}
}
if (currentRegion != null)
{
writer.WriteLine("#endregion");
writer.WriteLine();
currentRegion = null;
}
}