Пример #1
0
 public virtual ISymbolReference ToReference()
 {
     if (owner == null)
     {
         return(TypeParameterReference.Create(ownerType, index));
     }
     return(new OwnedTypeParameterReference(owner.ToReference(), index));
 }
Пример #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));
     }
 }
Пример #3
0
 public ITypeReference ToTypeReference()
 {
     return(TypeParameterReference.Create(this.OwnerType, this.Index));
 }
Пример #4
0
 public override ITypeReference ToTypeReference()
 {
     return(TypeParameterReference.Create(ownerType, index));
 }