internal override void Initialize(PropertyInfo propertyInfo, XBindingFlags flags) { base.Initialize(propertyInfo, flags); var getMethod = propertyInfo.GetGetMethod((flags & XBindingFlags.NonPublic) != 0); var setMethod = propertyInfo.GetSetMethod((flags & XBindingFlags.NonPublic) != 0); if (getMethod != null) { _get = MethodHelper.CreateDelegate <XStaticGetValueHandler <TValue> >(getMethod, SignatureLevels.Cast); } if (setMethod != null) { _set = MethodHelper.CreateDelegate <XStaticSetValueHandler <TValue> >(setMethod, SignatureLevels.Cast); } }
internal override void InitializeByRef(PropertyInfo propertyInfo, XBindingFlags flags) { base.InitializeByRef(propertyInfo, flags); var getMethod = propertyInfo.GetGetMethod((flags & XBindingFlags.NonPublic) != 0); if (getMethod != null) { var _ref = MethodHelper.CreateDelegate <XStaticRefValueHandler <TValue> >(getMethod, SignatureLevels.Cast); _get = () => { return(_ref()); }; _set = (value) => { _ref() = value; }; } }
private protected override void InitializeByRef(PropertyInfo propertyInfo, XBindingFlags flags) { base.InitializeByRef(propertyInfo, flags); if (_get == null || _set == null) { var getMethod = propertyInfo.GetGetMethod((flags & XBindingFlags.NonPublic) != 0); if (getMethod != null) { var _ref = MethodHelper.CreateDelegate <XStaticRefValueHandler <TValue> >(getMethod, false); _get = () => { return(_ref()); }; _set = (value) => { _ref() = value; }; } } }
private protected override void InitializeByValue(PropertyInfo propertyInfo, XBindingFlags flags) { base.InitializeByValue(propertyInfo, flags); if (_get == null) { var getMethod = propertyInfo.GetGetMethod((flags & XBindingFlags.NonPublic) != 0); if (getMethod != null) { _get = MethodHelper.CreateDelegate <XStaticGetValueHandler <TValue> >(getMethod, false); } } if (_set == null) { var setMethod = propertyInfo.GetSetMethod((flags & XBindingFlags.NonPublic) != 0); if (setMethod != null) { _set = MethodHelper.CreateDelegate <XStaticSetValueHandler <TValue> >(setMethod, false); } } }