System.Runtime.InteropServices.SafeHandle.SetHandle C# (CSharp) Method

SetHandle() private method

private SetHandle ( IntPtr handle ) : void
handle IntPtr
return void
		protected void SetHandle (IntPtr handle)
		{
			this.handle = handle;
		}

Usage Example

示例#1
0
 /// <summary>
 /// Initializes the underlying handle of a newly created <see cref="SafeHandle" /> to the provided value.
 /// </summary>
 /// <param name="safeHandle"><see cref="SafeHandle"/> instance to update</param>
 /// <param name="handle">Pre-existing handle</param>
 public static void InitHandle(SafeHandle safeHandle, IntPtr handle)
 {
     // To help maximize performance of P/Invokes, don't check if safeHandle is null.
     safeHandle.SetHandle(handle);
 }