Пример #1
0
 /// <summary>
 /// Creates a new <see cref="GenericParameterDicitonary"/> with the <paramref name="owner"/> provided.
 /// </summary>
 /// <param name="owner">The <see cref="CliGenericTypeBase{TIdentifier, TType}"/> which
 /// contains the generic parameters.</param>
 internal TypeParameterDictionary(CliGenericTypeBase <TIdentifier, TType> owner)
 {
     if (owner.MetadataEntry.TypeParameters == null)
     {
         this.Initialize(new ICliMetadataGenericParameterTableRow[0]);
     }
     else
     {
         if (owner.Parent is IGenericType)
         {
             var parentGeneric = (IGenericType)owner.Parent;
             if (parentGeneric.IsGenericConstruct)
             {
                 this.Initialize(owner.MetadataEntry.TypeParameters.Skip(parentGeneric.GenericParameters.Count).ToArray());
             }
             else
             {
                 this.Initialize(owner.MetadataEntry.TypeParameters);
             }
         }
         else
         {
             this.Initialize(owner.MetadataEntry.TypeParameters);
         }
     }
     this.owner = owner;
 }
Пример #2
0
 internal GenericParameter(CliGenericTypeBase <TIdentifier, TType> owner, ICliMetadataGenericParameterTableRow metadataEntry, int index)
     : base((TType)(object)owner, metadataEntry, index)
 {
 }