Inheritance: FieldReference, IMemberDefinition, IConstantProvider, IMarshalInfoProvider
Esempio n. 1
0
        public FieldDesc LookupFieldDesc(FieldDefinition fieldDef)
        {
            FieldDesc fieldDesc = null;

            if (ParentMethodTable != null)
            {
                fieldDesc = ParentMethodTable.EEClass.LookupFieldDesc(fieldDef);
                if (fieldDesc != null)
                {
                    return fieldDesc;
                }
            }

            // TODO: to be thread safety
            if (!_descByDefs.ContainsKey(fieldDef))
            {
                foreach (var f in FieldDescList)
                {
                    if (f.Definition == fieldDef)
                    {
                        fieldDesc = _descByDefs[fieldDef] = f;
                        break;
                    }
                }
            }
            else
            {
                fieldDesc = _descByDefs[fieldDef];
            }

            return fieldDesc;
        }
Esempio n. 2
0
 public FieldDesc(FieldDefinition fieldDef)
 {
     Definition = fieldDef;
 }
Esempio n. 3
0
 public FieldDesc LookupFieldDescFromFieldDef(FieldDefinition fieldDef)
 {
     return _fieldDescByFieldDef.ContainsKey(fieldDef) ? _fieldDescByFieldDef[fieldDef] : null;
 }
Esempio n. 4
0
 public void RegisterFieldDesc(FieldDefinition fieldDef, FieldDesc fieldDesc)
 {
     _fieldDescByFieldDef[fieldDef] = fieldDesc;
 }
Esempio n. 5
0
		public void AddFieldDefinition (FieldDefinition field)
		{
			Fields [field.token.RID - 1] = field;
		}