public PropertyReference(EvaluationContext ctx, PropertyInfo prop, CorValRef thisobj, CorApi.Portable.Type declaringType, CorValRef[] index)
            : base(ctx)
        {
            this.prop          = prop;
            this.declaringType = declaringType;
            if (declaringType.CorType == CorApi.Portable.CorElementType.ElementTypeArray ||
                declaringType.CorType == CorApi.Portable.CorElementType.ElementTypeSzarray)
            {
                this.module = ((CorApi.Portable.Type)((CorEvaluationContext)ctx).Adapter.GetType(ctx, "System.Object")).Class.Module;
            }
            else
            {
                this.module = declaringType.Class.Module;
            }
            this.index = index;
            if (!prop.GetGetMethod(true).IsStatic)
            {
                this.thisobj = thisobj;
            }

            flags = GetFlags(prop);

            loader = delegate {
                return(((CorValRef)Value).Val);
            };
        }
Пример #2
0
        public FieldReference(EvaluationContext ctx, CorValRef thisobj, CorApi.Portable.Type type, FieldInfo field, string vname, ObjectValueFlags vflags) : base(ctx)
        {
            this.thisobj = thisobj;
            this.type    = type;
            this.field   = field;
            this.vname   = vname;
            if (field.IsStatic)
            {
                this.thisobj = null;
            }

            flags = vflags | GetFlags(field);

            loader = delegate {
                return(((CorValRef)Value).Val);
            };
        }
Пример #3
0
 public FieldReference(EvaluationContext ctx, CorValRef thisobj, CorApi.Portable.Type type, FieldInfo field)
     : this(ctx, thisobj, type, field, null, ObjectValueFlags.Field)
 {
 }
 public PropertyReference(EvaluationContext ctx, PropertyInfo prop, CorValRef thisobj, CorApi.Portable.Type declaringType)
     : this(ctx, prop, thisobj, declaringType, null)
 {
 }