AcTools.Windows.Input.KeyboardListener.UnsubscribeInner C# (CSharp) Method

UnsubscribeInner() private static method

private static UnsubscribeInner ( KeyboardListener instance ) : void
instance KeyboardListener
return void
        private static void UnsubscribeInner(KeyboardListener instance) {
            if (Subscribed.Remove(instance) && Subscribed.Count == 0 && _hookHandle != 0) {
                var result = User32.UnhookWindowsHookEx(_hookHandle);
                _hookHandle = 0;
                _hookProc = null;

                AcToolsLogging.Write("Unsubscribed: " + result);
                if (result == 0) throw new Win32Exception(Marshal.GetLastWin32Error());
            }
        }
        #endregion