81c8003ee266e02fcad74078e3c62da7e68395b4
[mono.git] / mcs / class / System / Mono.AppleTls / INativeObject.cs
1 using System;
2
3 namespace ObjCRuntime {
4
5         internal interface INativeObject {
6                 IntPtr Handle { 
7                         get;
8                 }
9         }
10
11         static class NativeObjectHelper {
12
13                 // help to avoid the (too common pattern)
14                 //      var p = x == null ? IntPtr.Zero : x.Handle;
15                 static public IntPtr GetHandle (this INativeObject self)
16                 {
17                         return self == null ? IntPtr.Zero : self.Handle;
18                 }
19         }
20
21 }