+ public static bool HasAnyTypeParameterTypeConstrained (IGenericMethodDefinition md)
+ {
+ var tps = md.TypeParameters;
+ for (int i = 0; i < md.TypeParametersCount; ++i) {
+ if (tps[i].HasAnyTypeConstraint) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ public static bool HasAnyTypeParameterConstrained (IGenericMethodDefinition md)
+ {
+ var tps = md.TypeParameters;
+ for (int i = 0; i < md.TypeParametersCount; ++i) {
+ if (tps[i].IsConstrained) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+