Пример #1
0
        public FieldInfo resolve(FieldReference fieldReference)
        {
            initFields();

            List <FieldInfo> list;

            if (!fields.TryGetValue(fieldReference.Name, out list))
            {
                return(null);
            }

            var git = fieldReference.DeclaringType as GenericInstanceType;

            if (git != null)
            {
                fieldReference = FieldReferenceInstance.make(fieldReference, git);
            }

            foreach (var field in list)
            {
                if (ResolverUtils.compareFields(field, fieldReference))
                {
                    return(field);
                }
            }

            return(null);
        }
Пример #2
0
 FieldInfo resolveGlobalField(IField fieldRef)
 {
     initGlobalFields();
     foreach (var globalField in globalFields)
     {
         if (ResolverUtils.compareFields(globalField, fieldRef))
         {
             return(globalField);
         }
     }
     return(null);
 }
        public FieldInfo resolve(IField fieldRef)
        {
            initFields();

            List <FieldInfo> list;

            if (!fields.TryGetValue(fieldRef.Name.String, out list))
            {
                return(null);
            }

            fieldRef = GenericArgsSubstitutor.create(fieldRef, fieldRef.DeclaringType.TryGetGenericInstSig());

            foreach (var field in list)
            {
                if (ResolverUtils.compareFields(field, fieldRef))
                {
                    return(field);
                }
            }

            return(null);
        }