2017-04-10 11:41:01 +00:00
|
|
|
using System;
|
|
|
|
|
2017-06-07 13:16:24 +00:00
|
|
|
namespace ObjCRuntimeInternal {
|
2017-04-10 11:41:01 +00:00
|
|
|
|
|
|
|
internal interface INativeObject {
|
|
|
|
IntPtr Handle {
|
|
|
|
get;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static class NativeObjectHelper {
|
|
|
|
|
|
|
|
// help to avoid the (too common pattern)
|
|
|
|
// var p = x == null ? IntPtr.Zero : x.Handle;
|
|
|
|
static public IntPtr GetHandle (this INativeObject self)
|
|
|
|
{
|
|
|
|
return self == null ? IntPtr.Zero : self.Handle;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|