IsGenericMethod() public static method

public static IsGenericMethod ( IEntity entity ) : bool
entity IEntity
return bool
コード例 #1
0
ファイル: GenericsServices.cs プロジェクト: codehaus/boo
 /// <summary>
 /// Checks if a specified entity is not a generic definition.
 /// </summary>
 public bool NotGenericDefinition(IEntity entity)
 {
     if (!(GenericsServices.IsGenericType(entity) || GenericsServices.IsGenericMethod(entity)))
     {
         Errors.Add(CompilerErrorFactory.NotAGenericDefinition(ConstructionNode, entity.FullName));
         return(true);
     }
     return(false);
 }
コード例 #2
0
ファイル: GenericsServices.cs プロジェクト: codehaus/boo
 /// <summary>
 /// Gets the generic parameters associated with a generic type or generic method definition.
 /// </summary>
 /// <returns>An array of IGenericParameter objects, or null if the specified entity isn't a generic definition.</returns>
 private static IGenericParameter[] GetGenericParameters(IEntity definition)
 {
     if (GenericsServices.IsGenericType(definition))
     {
         return(((IType)definition).GenericInfo.GenericParameters);
     }
     if (GenericsServices.IsGenericMethod(definition))
     {
         return(((IMethod)definition).GenericInfo.GenericParameters);
     }
     return(null);
 }