Esempio n. 1
0
 private void GetUnderlyingTypeOfEnumNode(EnumNode /*!*/enumNode, FieldRow[]/*!*/ fieldDefs, FieldPtrRow[]/*!*/ fieldPtrs, int start, int end)
 {
     TypeNode underlyingType = null;
     for (int i = start; i < end; i++)
     {
         int ii = i;
         if (fieldPtrs.Length > 0) ii = fieldPtrs[i - 1].Field;
         FieldRow fld = fieldDefs[ii - 1];
         if (fld.Field != null && !fld.Field.IsStatic)
         {
             underlyingType = fld.Field.Type;
             break;
         }
         FieldFlags fieldFlags = (FieldFlags)fld.Flags;
         if ((fieldFlags & FieldFlags.Static) == 0)
         {
             this.tables.GetSignatureLength(fld.Signature);
             MemoryCursor sigReader = this.tables.GetNewCursor();
             GetAndCheckSignatureToken(6, sigReader);
             underlyingType = this.ParseTypeSignature(sigReader);
             break;
         }
     }
     enumNode.underlyingType = underlyingType;
 }
Esempio n. 2
0
 private void AddFieldsToType(TypeNode/*!*/ type, FieldRow[]/*!*/ fieldDefs, FieldPtrRow[]/*!*/ fieldPtrs, int start, int end)
 {
     for (int i = start; i < end; i++)
     {
         int ii = i;
         if (fieldPtrs.Length > 0) ii = fieldPtrs[i - 1].Field;
         Field field = this.GetFieldFromDef(ii, type);
         if (field != null) type.Members.Add(field);
     }
 }