sqliteconnectionhandle.cs

来自「破解的飞信源代码」· CS 代码 · 共 43 行

CS
43
字号
namespace Imps.Client.Data
{
    using System;
    using System.Runtime.InteropServices;

    internal class SQLiteConnectionHandle : CriticalHandle
    {
        internal SQLiteConnectionHandle() : base(IntPtr.Zero)
        {
        }

        private SQLiteConnectionHandle(IntPtr db) : this()
        {
            base.SetHandle(db);
        }

        public static implicit operator IntPtr(SQLiteConnectionHandle db)
        {
            return db.handle;
        }

        public static implicit operator SQLiteConnectionHandle(IntPtr db)
        {
            return new SQLiteConnectionHandle(db);
        }

        protected override bool ReleaseHandle()
        {
            SQLiteBase.Close(this);
            return true;
        }

        public override bool IsInvalid
        {
            get
            {
                return (base.handle == IntPtr.Zero);
            }
        }
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?