aboutsummaryrefslogtreecommitdiff
path: root/src/ProtocolBuffers/FieldAccess/ReflectionUtil.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/ProtocolBuffers/FieldAccess/ReflectionUtil.cs')
-rw-r--r--src/ProtocolBuffers/FieldAccess/ReflectionUtil.cs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/ProtocolBuffers/FieldAccess/ReflectionUtil.cs b/src/ProtocolBuffers/FieldAccess/ReflectionUtil.cs
index 84c53e26..92e8a07c 100644
--- a/src/ProtocolBuffers/FieldAccess/ReflectionUtil.cs
+++ b/src/ProtocolBuffers/FieldAccess/ReflectionUtil.cs
@@ -71,7 +71,7 @@ namespace Google.ProtocolBuffers.FieldAccess
// Convert the reflection call into an open delegate, i.e. instead of calling x.Method()
// we'll call getter(x).
Func<TSource, TResult> getter =
- (Func<TSource, TResult>) Delegate.CreateDelegate(typeof(Func<TSource, TResult>), null, method);
+ (Func<TSource, TResult>)FrameworkPortability.CreateDelegate(typeof(Func<TSource, TResult>), null, method);
// Implicit upcast to object (within the delegate)
return delegate(TSource source) { return getter(source); };
@@ -93,7 +93,7 @@ namespace Google.ProtocolBuffers.FieldAccess
// Convert the reflection call into an open delegate, i.e. instead of calling x.Method(y) we'll
// call Method(x, y)
Action<TSource, TParam> call =
- (Action<TSource, TParam>) Delegate.CreateDelegate(typeof(Action<TSource, TParam>), null, method);
+ (Action<TSource, TParam>)FrameworkPortability.CreateDelegate(typeof(Action<TSource, TParam>), null, method);
return delegate(TSource source, object parameter) { call(source, (TParam) parameter); };
}
@@ -116,7 +116,7 @@ namespace Google.ProtocolBuffers.FieldAccess
// Convert the reflection call into an open delegate, i.e. instead of calling x.Method(y) we'll
// call Method(x, y)
Func<TSource, TParam, TReturn> call = (Func<TSource, TParam, TReturn>)
- Delegate.CreateDelegate(typeof(Func<TSource, TParam, TReturn>), null,
+ FrameworkPortability.CreateDelegate(typeof(Func<TSource, TParam, TReturn>), null,
method);
return delegate(TSource source, object parameter) { call(source, (TParam) parameter); };
@@ -134,7 +134,7 @@ namespace Google.ProtocolBuffers.FieldAccess
public static Func<IBuilder> CreateStaticUpcastDelegateImpl<T>(MethodInfo method)
{
- Func<T> call = (Func<T>) Delegate.CreateDelegate(typeof(Func<T>), null, method);
+ Func<T> call = (Func<T>)FrameworkPortability.CreateDelegate(typeof(Func<T>), null, method);
return delegate { return (IBuilder) call(); };
}
}