Beispiel #1
0
 /// <summary>
 /// Checks the constraint.
 /// </summary>
 /// <param name="parameterType">Type of the parameter.</param>
 /// <param name="typeToCheck">The type to check.</param>
 /// <returns></returns>
 public bool CheckConstraint(GenericParameterType parameterType, TypeBase typeToCheck)
 {
     foreach (var genericParameterConstraint in ParameterConstraints)
     {
         if (genericParameterConstraint.Name == parameterType.Name)
         {
             return(genericParameterConstraint.Constraint(typeToCheck));
         }
     }
     return(false);
 }
Beispiel #2
0
 /// <summary>
 /// Checks the constraint.
 /// </summary>
 /// <param name="parameterType">Type of the parameter.</param>
 /// <param name="typeToCheck">The type to check.</param>
 /// <returns></returns>
 public bool CheckConstraint(GenericParameterType parameterType, TypeBase typeToCheck)
 {
     foreach (var genericParameterConstraint in ParameterConstraints)
     {
         if (genericParameterConstraint.Name == parameterType.Name)
         {
             return genericParameterConstraint.Constraint(typeToCheck);
         }
     }
     return false;
 }