Exemplo n.º 1
0
 public virtual ISymbolReference ToReference()
 {
     if (owner == null)
     {
         return(TypeParameterReference.Create(ownerType, index));
     }
     return(new OwnedTypeParameterReference(owner.ToReference(), index));
 }
Exemplo n.º 2
0
 /// <summary>
 /// Creates a type parameter reference.
 /// For common type parameter references, this method may return a shared instance.
 /// </summary>
 public static TypeParameterReference Create(SymbolKind ownerType, int index)
 {
     if (index >= 0 && index < 8 && (ownerType == SymbolKind.TypeDefinition || ownerType == SymbolKind.Method))
     {
         TypeParameterReference[] arr    = (ownerType == SymbolKind.TypeDefinition) ? classTypeParameterReferences : methodTypeParameterReferences;
         TypeParameterReference   result = LazyInit.VolatileRead(ref arr[index]);
         if (result == null)
         {
             result = LazyInit.GetOrSet(ref arr[index], new TypeParameterReference(ownerType, index));
         }
         return(result);
     }
     else
     {
         return(new TypeParameterReference(ownerType, index));
     }
 }
Exemplo n.º 3
0
 public ITypeReference ToTypeReference()
 {
     return(TypeParameterReference.Create(this.OwnerType, this.Index));
 }
Exemplo n.º 4
0
 public override ITypeReference ToTypeReference()
 {
     return(TypeParameterReference.Create(ownerType, index));
 }