|
|
@@ -7,10 +7,7 @@
|
|
|
// Patrik Torstensson ([email protected])
|
|
|
//
|
|
|
// (C) 2001 Ximian, Inc. http://www.ximian.com
|
|
|
-//
|
|
|
-
|
|
|
-//
|
|
|
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
|
|
|
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
|
|
|
//
|
|
|
// Permission is hereby granted, free of charge, to any person obtaining
|
|
|
// a copy of this software and associated documentation files (the
|
|
|
@@ -32,10 +29,10 @@
|
|
|
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
//
|
|
|
|
|
|
-using System;
|
|
|
using System.Globalization;
|
|
|
using System.Runtime.CompilerServices;
|
|
|
using System.Runtime.InteropServices;
|
|
|
+using System.Security;
|
|
|
|
|
|
namespace System.Reflection {
|
|
|
|
|
|
@@ -200,11 +197,16 @@ namespace System.Reflection {
|
|
|
MethodInfo method = GetGetMethod (true);
|
|
|
if (method == null)
|
|
|
throw new ArgumentException ("Get Method not found for '" + Name + "'");
|
|
|
-
|
|
|
- if (index == null || index.Length == 0)
|
|
|
- ret = method.Invoke (obj, invokeAttr, binder, null, culture);
|
|
|
- else
|
|
|
- ret = method.Invoke (obj, invokeAttr, binder, index, culture);
|
|
|
+
|
|
|
+ try {
|
|
|
+ if (index == null || index.Length == 0)
|
|
|
+ ret = method.Invoke (obj, invokeAttr, binder, null, culture);
|
|
|
+ else
|
|
|
+ ret = method.Invoke (obj, invokeAttr, binder, index, culture);
|
|
|
+ }
|
|
|
+ catch (SecurityException se) {
|
|
|
+ throw new TargetInvocationException (se);
|
|
|
+ }
|
|
|
|
|
|
return ret;
|
|
|
}
|