EnumCustomAttributes() public method

public EnumCustomAttributes ( int mdToken, int result, int count ) : void
mdToken int
result int
count int
return void
Example #1
0
        internal static CustomAttributeRecord[] GetCustomAttributeRecords(RuntimeModule module, int targetToken)
        {
            MetadataImport     metadataImport = module.MetadataImport;
            MetadataEnumResult result;

            metadataImport.EnumCustomAttributes(targetToken, out result);
            CustomAttributeRecord[] customAttributeRecordArray = new CustomAttributeRecord[result.Length];
            for (int index = 0; index < customAttributeRecordArray.Length; ++index)
            {
                metadataImport.GetCustomAttributeProps(result[index], out customAttributeRecordArray[index].tkCtor.Value, out customAttributeRecordArray[index].blob);
            }
            return(customAttributeRecordArray);
        }
Example #2
0
        internal static CustomAttributeRecord[] GetCustomAttributeRecords(RuntimeModule module, int targetToken)
        {
            MetadataImport     metadataImport = module.MetadataImport;
            MetadataEnumResult metadataEnumResult;

            metadataImport.EnumCustomAttributes(targetToken, out metadataEnumResult);
            CustomAttributeRecord[] array = new CustomAttributeRecord[metadataEnumResult.Length];
            for (int i = 0; i < array.Length; i++)
            {
                metadataImport.GetCustomAttributeProps(metadataEnumResult[i], out array[i].tkCtor.Value, out array[i].blob);
            }
            return(array);
        }
Example #3
0
        internal static unsafe CustomAttributeRecord[] GetCustomAttributeRecords(RuntimeModule module, int targetToken)
        {
            MetadataImport metadataImport = module.MetadataImport;
            int            count          = metadataImport.EnumCustomAttributesCount(targetToken);
            int *          result         = (int *)stackalloc byte[(((IntPtr)count) * 4)];

            metadataImport.EnumCustomAttributes(targetToken, result, count);
            CustomAttributeRecord[] recordArray = new CustomAttributeRecord[count];
            for (int i = 0; i < count; i++)
            {
                metadataImport.GetCustomAttributeProps(result[i], out recordArray[i].tkCtor.Value, out recordArray[i].blob);
            }
            return(recordArray);
        }