GetAccessorFor() static private method

static private GetAccessorFor ( FieldInfo field ) : FieldAccessor
field FieldInfo
return FieldAccessor
        public override Object GetValue(Object obj)
        {
            FieldAccessor accessor = this.fieldAccessor;

            if (accessor == null)
            {
                this.fieldAccessor = accessor = FieldAccessor.GetAccessorFor(TypeReferences.ToExecutionContext(this.field));
            }
            return(accessor.GetValue(obj));
        }
Beispiel #2
0
        public override Object GetValue(Object obj)
        {
            FieldAccessor accessor = this.fieldAccessor;

            if (accessor == null)
            {
                this.fieldAccessor = accessor = FieldAccessor.GetAccessorFor(this.field);
            }
            return(accessor.GetValue(obj));
        }
        public override void SetValue(object obj, object value, BindingFlags invokeAttr, Binder binder, CultureInfo culture)
        {
            FieldAccessor fieldAccessor = this.fieldAccessor;

            if (fieldAccessor == null)
            {
                this.fieldAccessor = fieldAccessor = FieldAccessor.GetAccessorFor(this.field);
            }
            fieldAccessor.SetValue(obj, value);
        }
        public override void SetValue(Object obj, Object value, BindingFlags invokeAttr, Binder binder, CultureInfo culture)
        {
            Debug.PreCondition(binder == null && culture == null);
            FieldAccessor accessor = this.fieldAccessor;

            if (accessor == null)
            {
                this.fieldAccessor = accessor = FieldAccessor.GetAccessorFor(this.field);
            }
            accessor.SetValue(obj, value);
        }