Пример #1
0
 void ComputeGenericParameters()
 {
     var genericParameterHandles = _typeDefinition.GetGenericParameters();
     int count = genericParameterHandles.Count;
     if (count > 0)
     {
         TypeDesc[] genericParameters = new TypeDesc[count];
         int i = 0;
         foreach (var genericParameterHandle in genericParameterHandles)
         {
             genericParameters[i++] = new EcmaGenericParameter(this.Module, genericParameterHandle);
         }
         Interlocked.CompareExchange(ref _genericParameters, genericParameters, null);
     }
     else
     {
         _genericParameters = TypeDesc.EmptyTypes;
     }
 }
Пример #2
0
        private void ComputeGenericParameters()
        {
            var genericParameterHandles = _typeDefinition.GetGenericParameters();
            int count = genericParameterHandles.Count;

            if (count > 0)
            {
                TypeDesc[] genericParameters = new TypeDesc[count];
                int        i = 0;
                foreach (var genericParameterHandle in genericParameterHandles)
                {
                    genericParameters[i++] = new EcmaGenericParameter(_module, genericParameterHandle);
                }
                Interlocked.CompareExchange(ref _genericParameters, genericParameters, null);
            }
            else
            {
                _genericParameters = TypeDesc.EmptyTypes;
            }
        }