Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
2003-03-03 Tim Coleman <tim@timcoleman.com>
* HandleRef.cs: Add this struct svn path=/trunk/mcs/; revision=12164
- Loading branch information
Tim Coleman
committed
Mar 3, 2003
1 parent
77c3b54
commit 78c4ae6
Showing
2 changed files
with
55 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
mcs/class/corlib/System.Runtime.InteropServices/HandleRef.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
// | ||
// System.Runtime.InteropServices.HandleRef | ||
// | ||
// Author: | ||
// Tim Coleman (tim@timcoleman.com) | ||
// | ||
// Copyright (C) 2003 Tim Coleman | ||
|
||
using System; | ||
|
||
namespace System.Runtime.InteropServices { | ||
public struct HandleRef { | ||
|
||
#region Fields | ||
|
||
object wrapper; | ||
IntPtr handle; | ||
|
||
#endregion // Fields | ||
|
||
#region Constructors | ||
|
||
public HandleRef (object wrapper, IntPtr handle) | ||
{ | ||
this.wrapper = wrapper; | ||
this.handle = handle; | ||
} | ||
|
||
#endregion // Constructors | ||
|
||
#region Properties | ||
|
||
public IntPtr Handle { | ||
get { return handle; } | ||
} | ||
|
||
public object Wrapper { | ||
get { return wrapper; } | ||
} | ||
|
||
#endregion // Properties | ||
|
||
#region Type Conversions | ||
|
||
public static explicit operator IntPtr (HandleRef value) | ||
{ | ||
return value.Handle; | ||
} | ||
|
||
#endregion // Type Conversions | ||
} | ||
} |