示例#1
0
 public IType Resolve(ITypeResolveContext context)
 {
     if (ownerType == SymbolKind.Method)
     {
         IMethod method = context.CurrentMember as IMethod;
         if (method != null && index < method.TypeParameters.Count)
         {
             return(method.TypeParameters[index]);
         }
         return(DummyTypeParameter.GetMethodTypeParameter(index));
     }
     else if (ownerType == SymbolKind.TypeDefinition)
     {
         ITypeDefinition typeDef = context.CurrentTypeDefinition;
         if (typeDef != null && index < typeDef.TypeParameters.Count)
         {
             return(typeDef.TypeParameters[index]);
         }
         return(DummyTypeParameter.GetClassTypeParameter(index));
     }
     else
     {
         return(SpecialType.UnknownType);
     }
 }