GetField() static private method

static private GetField ( Collection fields, FieldReference reference ) : FieldDefinition
fields Collection
reference FieldReference
return FieldDefinition
 private FieldDefinition GetField(TypeDefinition type, FieldReference reference)
 {
     while (type != null)
     {
         FieldDefinition field = MetadataResolver.GetField(type.Fields, reference);
         if (field != null)
         {
             return(field);
         }
         if (type.BaseType == null)
         {
             return(null);
         }
         type = this.Resolve(type.BaseType);
     }
     return(null);
 }