|
10 | 10 | using PinvokeEnv = Java.Interop.JIPinvokes.JniEnvironment; |
11 | 11 | using XAIntPtrEnv = Java.Interop.XAIntPtrs.JniEnvironment; |
12 | 12 |
|
| 13 | +public class XFieldInfo |
| 14 | +{ |
| 15 | + public IntPtr ID; |
| 16 | + public bool IsStatic; |
| 17 | + public bool IsValid {get {return ID != IntPtr.Zero;}} |
| 18 | + public XFieldInfo (string name, string signature, IntPtr id, bool isStatic) |
| 19 | + { |
| 20 | + ID = id; |
| 21 | + IsStatic = isStatic; |
| 22 | + } |
| 23 | + public override string ToString () |
| 24 | + { |
| 25 | + return string.Format ("{0}(0x{1})", GetType ().FullName, ID.ToString ("x")); |
| 26 | + } |
| 27 | +} |
| 28 | + |
| 29 | +public class XMethodInfo |
| 30 | +{ |
| 31 | + public IntPtr ID; |
| 32 | + public bool IsStatic; |
| 33 | + public bool IsValid {get {return ID != IntPtr.Zero;}} |
| 34 | + public XMethodInfo (string name, string signature, IntPtr id, bool isStatic) |
| 35 | + { |
| 36 | + ID = id; |
| 37 | + IsStatic = isStatic; |
| 38 | + } |
| 39 | + public override string ToString () |
| 40 | + { |
| 41 | + return string.Format ("{0}(0x{1})", GetType ().FullName, ID.ToString ("x")); |
| 42 | + } |
| 43 | +} |
| 44 | + |
| 45 | + |
13 | 46 | namespace Java.Interop.SafeHandles { |
| 47 | + public class JniFieldInfo : XFieldInfo { |
| 48 | + public JniFieldInfo (string name, string signature, IntPtr id, bool isStatic) |
| 49 | + : base (name, signature, id, isStatic) |
| 50 | + { |
| 51 | + } |
| 52 | + } |
| 53 | + public class JniMethodInfo : XMethodInfo { |
| 54 | + public JniMethodInfo (string name, string signature, IntPtr id, bool isStatic) |
| 55 | + : base (name, signature, id, isStatic) |
| 56 | + { |
| 57 | + } |
| 58 | + } |
14 | 59 | public struct JniObjectReference |
15 | 60 | { |
16 | 61 | public JniReferenceSafeHandle SafeHandle {get; private set;} |
@@ -195,6 +240,18 @@ public static Exception GetExceptionForLastThrowable () |
195 | 240 | } |
196 | 241 |
|
197 | 242 | namespace Java.Interop.JIIntPtrs { |
| 243 | + public class JniFieldInfo : XFieldInfo { |
| 244 | + public JniFieldInfo (string name, string signature, IntPtr id, bool isStatic) |
| 245 | + : base (name, signature, id, isStatic) |
| 246 | + { |
| 247 | + } |
| 248 | + } |
| 249 | + public class JniMethodInfo : XMethodInfo { |
| 250 | + public JniMethodInfo (string name, string signature, IntPtr id, bool isStatic) |
| 251 | + : base (name, signature, id, isStatic) |
| 252 | + { |
| 253 | + } |
| 254 | + } |
198 | 255 | public struct JniObjectReference |
199 | 256 | { |
200 | 257 | public IntPtr Handle {get; private set;} |
@@ -236,6 +293,18 @@ public static Exception GetExceptionForLastThrowable () |
236 | 293 | } |
237 | 294 |
|
238 | 295 | namespace Java.Interop.JIPinvokes { |
| 296 | + public class JniFieldInfo : XFieldInfo { |
| 297 | + public JniFieldInfo (string name, string signature, IntPtr id, bool isStatic) |
| 298 | + : base (name, signature, id, isStatic) |
| 299 | + { |
| 300 | + } |
| 301 | + } |
| 302 | + public class JniMethodInfo : XMethodInfo { |
| 303 | + public JniMethodInfo (string name, string signature, IntPtr id, bool isStatic) |
| 304 | + : base (name, signature, id, isStatic) |
| 305 | + { |
| 306 | + } |
| 307 | + } |
239 | 308 | public struct JniObjectReference |
240 | 309 | { |
241 | 310 | public IntPtr Handle {get; private set;} |
@@ -282,6 +351,18 @@ public static Exception GetExceptionForLastThrowable () |
282 | 351 | } |
283 | 352 | } |
284 | 353 | namespace Java.Interop.XAIntPtrs { |
| 354 | + public class JniFieldInfo : XFieldInfo { |
| 355 | + public JniFieldInfo (string name, string signature, IntPtr id, bool isStatic) |
| 356 | + : base (name, signature, id, isStatic) |
| 357 | + { |
| 358 | + } |
| 359 | + } |
| 360 | + public class JniMethodInfo : XMethodInfo { |
| 361 | + public JniMethodInfo (string name, string signature, IntPtr id, bool isStatic) |
| 362 | + : base (name, signature, id, isStatic) |
| 363 | + { |
| 364 | + } |
| 365 | + } |
285 | 366 | public struct JniObjectReference |
286 | 367 | { |
287 | 368 | public IntPtr Handle {get; private set;} |
@@ -321,51 +402,6 @@ public static Exception GetExceptionForLastThrowable () |
321 | 402 | } |
322 | 403 | } |
323 | 404 |
|
324 | | -namespace Java.Interop { |
325 | | - public sealed class JniFieldInfo |
326 | | - { |
327 | | - public IntPtr ID; |
328 | | - public bool IsStatic; |
329 | | - public bool IsValid {get {return ID != IntPtr.Zero;}} |
330 | | - |
331 | | - public JniFieldInfo (IntPtr id, bool isStatic) |
332 | | - { |
333 | | - ID = id; |
334 | | - IsStatic = isStatic; |
335 | | - } |
336 | | - public JniFieldInfo (string name, string signature, IntPtr id, bool isStatic) |
337 | | - { |
338 | | - ID = id; |
339 | | - IsStatic = isStatic; |
340 | | - } |
341 | | - |
342 | | - public override string ToString () |
343 | | - { |
344 | | - return string.Format ("{0}(0x{1})", GetType ().FullName, ID.ToString ("x")); |
345 | | - } |
346 | | - } |
347 | | - public class JniMethodInfo |
348 | | - { |
349 | | - public IntPtr ID; |
350 | | - public bool IsStatic; |
351 | | - public bool IsValid {get {return ID != IntPtr.Zero;}} |
352 | | - public JniMethodInfo (IntPtr id, bool isStatic) |
353 | | - { |
354 | | - ID = id; |
355 | | - IsStatic = isStatic; |
356 | | - } |
357 | | - public JniMethodInfo (string name, string signature, IntPtr id, bool isStatic) |
358 | | - { |
359 | | - ID = id; |
360 | | - IsStatic = isStatic; |
361 | | - } |
362 | | - public override string ToString () |
363 | | - { |
364 | | - return string.Format ("{0}(0x{1})", GetType ().FullName, ID.ToString ("x")); |
365 | | - } |
366 | | - } |
367 | | -} |
368 | | - |
369 | 405 | class App { |
370 | 406 |
|
371 | 407 | public static void Main () |
|
0 commit comments