diff options
author | csharptest <roger@csharptest.net> | 2012-10-14 14:40:07 -0500 |
---|---|---|
committer | rogerk <devnull@localhost> | 2012-10-14 14:40:07 -0500 |
commit | fc353381e825945af8cd972a598a2c3da78111be (patch) | |
tree | dcda4dc2e1ffffda3c8089e77f57a53534987e36 /src/ProtocolBuffers/FieldAccess/SinglePrimitiveAccessor.cs | |
parent | 1ab73c6a6c23c3724674481489e18ebbb556caa6 (diff) | |
download | protobuf-fc353381e825945af8cd972a598a2c3da78111be.tar.gz protobuf-fc353381e825945af8cd972a598a2c3da78111be.tar.bz2 protobuf-fc353381e825945af8cd972a598a2c3da78111be.zip |
Refactored uses of CreateDelegate for compatibility with CF2
Diffstat (limited to 'src/ProtocolBuffers/FieldAccess/SinglePrimitiveAccessor.cs')
-rw-r--r-- | src/ProtocolBuffers/FieldAccess/SinglePrimitiveAccessor.cs | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/ProtocolBuffers/FieldAccess/SinglePrimitiveAccessor.cs b/src/ProtocolBuffers/FieldAccess/SinglePrimitiveAccessor.cs index e52af03d..e5a07540 100644 --- a/src/ProtocolBuffers/FieldAccess/SinglePrimitiveAccessor.cs +++ b/src/ProtocolBuffers/FieldAccess/SinglePrimitiveAccessor.cs @@ -67,11 +67,8 @@ namespace Google.ProtocolBuffers.FieldAccess throw new ArgumentException("Not all required properties/methods available");
}
clrType = messageProperty.PropertyType;
- hasDelegate =
- (Func<TMessage, bool>)
- FrameworkPortability.CreateDelegate(typeof(Func<TMessage, bool>), null, hasProperty.GetGetMethod());
- clearDelegate =
- (Func<TBuilder, IBuilder>)FrameworkPortability.CreateDelegate(typeof(Func<TBuilder, IBuilder>), null, clearMethod);
+ hasDelegate = ReflectionUtil.CreateDelegateFunc<TMessage, bool>(hasProperty.GetGetMethod());
+ clearDelegate = ReflectionUtil.CreateDelegateFunc<TBuilder, IBuilder>(clearMethod);
getValueDelegate = ReflectionUtil.CreateUpcastDelegate<TMessage>(messageProperty.GetGetMethod());
setValueDelegate = ReflectionUtil.CreateDowncastDelegate<TBuilder>(builderProperty.GetSetMethod());
}
|