diff options
author | detlevschwabe <detlev.schwabe@gmail.com> | 2016-06-27 22:31:42 -0700 |
---|---|---|
committer | Jon Skeet <skeet@pobox.com> | 2016-06-28 06:31:42 +0100 |
commit | dc0aeaa9030bdac264b44d56d07b6839a1ae94e9 (patch) | |
tree | 4c2fa16988a67942b15307b8da9fd0e1f3994a99 /csharp/src/Google.Protobuf/Compatibility/PropertyInfoExtensions.cs | |
parent | 7b5648ca98b6bde2b18db109bdf020944e0b7baa (diff) |
Adding conditional compiler symbol to support .NET 3.5 (#1713)
* Adding condition compiler symbol to support .NET 3.5
Diffstat (limited to 'csharp/src/Google.Protobuf/Compatibility/PropertyInfoExtensions.cs')
-rw-r--r-- | csharp/src/Google.Protobuf/Compatibility/PropertyInfoExtensions.cs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/csharp/src/Google.Protobuf/Compatibility/PropertyInfoExtensions.cs b/csharp/src/Google.Protobuf/Compatibility/PropertyInfoExtensions.cs index 8a6fefa7..e3914dd3 100644 --- a/csharp/src/Google.Protobuf/Compatibility/PropertyInfoExtensions.cs +++ b/csharp/src/Google.Protobuf/Compatibility/PropertyInfoExtensions.cs @@ -47,7 +47,11 @@ namespace Google.Protobuf.Compatibility /// </summary> internal static MethodInfo GetGetMethod(this PropertyInfo target) { +#if DOTNET35 + var method = target.GetGetMethod(); +#else var method = target.GetMethod; +#endif return method != null && method.IsPublic ? method : null; } @@ -57,7 +61,11 @@ namespace Google.Protobuf.Compatibility /// </summary> internal static MethodInfo GetSetMethod(this PropertyInfo target) { +#if DOTNET35 + var method = target.GetSetMethod(); +#else var method = target.SetMethod; +#endif return method != null && method.IsPublic ? method : null; } } |