From dc0aeaa9030bdac264b44d56d07b6839a1ae94e9 Mon Sep 17 00:00:00 2001 From: detlevschwabe Date: Mon, 27 Jun 2016 22:31:42 -0700 Subject: Adding conditional compiler symbol to support .NET 3.5 (#1713) * Adding condition compiler symbol to support .NET 3.5 --- csharp/src/Google.Protobuf/Compatibility/TypeExtensions.cs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'csharp/src/Google.Protobuf/Compatibility/TypeExtensions.cs') diff --git a/csharp/src/Google.Protobuf/Compatibility/TypeExtensions.cs b/csharp/src/Google.Protobuf/Compatibility/TypeExtensions.cs index 762a29eb..fe9cda8d 100644 --- a/csharp/src/Google.Protobuf/Compatibility/TypeExtensions.cs +++ b/csharp/src/Google.Protobuf/Compatibility/TypeExtensions.cs @@ -49,6 +49,11 @@ namespace Google.Protobuf.Compatibility /// Returns true if the target type is a value type, including a nullable value type or an enum, or false /// if it's a reference type (class, delegate, interface - including System.ValueType and System.Enum). /// +#if DOTNET35 + internal static bool IsValueType(this Type target) { + return target.IsValueType; + } +#else internal static bool IsValueType(this Type target) { return target.GetTypeInfo().IsValueType; @@ -109,5 +114,6 @@ namespace Google.Protobuf.Compatibility } return null; } +#endif } } -- cgit v1.2.3