void GenerateGenericsConstraints (CodeTypeParameterCollection parameters)
{
int count = parameters.Count;
if (count == 0)
return;
bool indented = false;
for (int i = 0; i < count; i++) {
CodeTypeParameter p = parameters [i];
bool hasConstraints = (p.Constraints.Count != 0);
Output.WriteLine ();
if (!hasConstraints && !p.HasConstructorConstraint)
continue;
if (!indented) {
++Indent;
indented = true;
}
Output.Write ("where ");
Output.Write (p.Name);
Output.Write (" : ");
for (int j = 0; j < p.Constraints.Count; j++) {
if (j > 0)
Output.Write (", ");
OutputType (p.Constraints [j]);
}
if (p.HasConstructorConstraint) {
if (hasConstraints)
Output.Write (", ");
Output.Write ("new");
if (hasConstraints)
Output.Write (" ");
Output.Write ("()");
}
}
if (indented)
--Indent;
}