Release 4.0.0-preview1-00183
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / internal / dotnetcore / HandleRef.cs
1 // ==++==
2 // 
3 //   Copyright (c) Microsoft Corporation.  All rights reserved.
4 // 
5 // ==--==
6 namespace System.Runtime.InteropServices
7 {
8
9     using System;
10
11     [System.Runtime.InteropServices.ComVisible(true)]
12     public struct HandleRef
13     {
14
15         // ! Do not add or rearrange fields as the EE depends on this layout.
16         //------------------------------------------------------------------
17         internal Object m_wrapper;
18         internal IntPtr m_handle;
19         //------------------------------------------------------------------
20
21
22         public HandleRef(Object wrapper, IntPtr handle)
23         {
24             m_wrapper = wrapper;
25             m_handle = handle;
26         }
27
28         public Object Wrapper
29         {
30             get
31             {
32                 return m_wrapper;
33             }
34         }
35
36         public IntPtr Handle
37         {
38             get
39             {
40                 return m_handle;
41             }
42         }
43
44
45         public static explicit operator IntPtr(HandleRef value)
46         {
47             return value.m_handle;
48         }
49
50         public static IntPtr ToIntPtr(HandleRef value)
51         {
52             return value.m_handle;
53         }
54     }
55 }