示例#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);
 }
示例#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;
 }