BindingFlags.Public needed here as Exception.HResult is now public in .NET 4.5. This...
[mono.git] / mcs / class / System.Drawing / System.Drawing / ComIStreamMarshaler.cs
index 4842d15cef314ca1dd5e59de830bc985dab2385b..5064cae15d46d1309660181a87aa652941653ef0 100644 (file)
@@ -38,12 +38,8 @@ using System;
 using System.IO;
 using System.Reflection;
 using System.Runtime.InteropServices;
-#if NET_2_0
 using System.Runtime.InteropServices.ComTypes;
 using STATSTG = System.Runtime.InteropServices.ComTypes.STATSTG;
-#else
-using IStream = System.Runtime.InteropServices.UCOMIStream;
-#endif
 
 namespace System.Drawing
 {
@@ -109,7 +105,7 @@ namespace System.Drawing
 
                        private static readonly Guid IID_IUnknown = new Guid("00000000-0000-0000-C000-000000000046");
                        private static readonly Guid IID_IStream = new Guid("0000000C-0000-0000-C000-000000000046");
-                       private static readonly MethodInfo exceptionGetHResult = typeof(Exception).GetProperty("HResult", BindingFlags.GetProperty | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly | BindingFlags.ExactBinding, null, typeof(int), new Type[] {}, null).GetGetMethod(true);
+                       private static readonly MethodInfo exceptionGetHResult = typeof(Exception).GetProperty("HResult", BindingFlags.GetProperty | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly | BindingFlags.ExactBinding, null, typeof(int), new Type[] {}, null).GetGetMethod(true);
                        // Keeps delegates alive while they are marshaled
                        private static readonly IStreamVtbl managedVtable;
                        private static IntPtr comVtable;
@@ -717,4 +713,4 @@ namespace System.Drawing
                        return -1;
                }
        }
-}
\ No newline at end of file
+}