📄 safetransactionhandle.cs
字号:
using System;
using System.Runtime.Versioning;
using System.Security.Permissions;
using Microsoft.Win32.SafeHandles;
namespace Wrox.ProCSharp.Transactions
{
[SecurityPermission(SecurityAction.LinkDemand, UnmanagedCode = true)]
public sealed class SafeTransactionHandle : SafeHandleZeroOrMinusOneIsInvalid
{
private SafeTransactionHandle()
: base(true)
{
}
public SafeTransactionHandle(IntPtr preexistingHandle, bool ownsHandle)
: base(ownsHandle)
{
SetHandle(preexistingHandle);
}
[ResourceExposure(ResourceScope.Machine)]
[ResourceConsumption(ResourceScope.Machine)]
protected override bool ReleaseHandle()
{
return NativeMethods.CloseHandle(handle);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -