private void UnsubscribeEvents() { if (this.bindedKeyHoldManager != null) { this.bindedKeyHoldManager.BindedKeyHoldEvent -= OnBindedKeyHoldEvent; this.bindedKeyHoldManager.Dispose(); this.bindedKeyHoldManager = null; } if (this.windowControls != null) { this.windowControls.WindowHideEvent -= this.HideWindow; this.windowControls.Dispose(); this.windowControls = null; } }
private void SubscribeEvents() { if (this.keyHoldHook == null) { this.keyHoldHook = new L45KeyHoldHook(); } if (this.bindedKeyHoldManager == null) { this.bindedKeyHoldManager = new BindedKeyHoldManager(this.keyHoldHook); } this.bindedKeyHoldManager.BindedKeyHoldEvent += OnBindedKeyHoldEvent; if (this.windowControls == null) { this.windowControls = new WindowControls(this, this.keyHoldHook); } this.windowControls.WindowHideEvent += this.HideWindow; }