public void Dispose()
    {
        ObjectRegistry?.Dispose();
        ObjectRegistry = null;

        Actions?.Dispose();
        Actions = null;

        Initiative?.Dispose();
        Initiative = null;

        Hotkeys?.Dispose();
        Hotkeys = null;

        BuffDebuff?.Dispose();
        BuffDebuff = null;
    }
Exemple #2
0
        internal void PrepareKeyboardHook()
        {
            KeyModifiers mod = KeyModifiers.None;

            try
            {
                if (hotKeys != null)
                {
                    hotKeys.Dispose();
                    hotKeys = null;
                }

                if (ringKeys != null)
                {
                    ringKeys.Dispose();
                    ringKeys = null;
                }

                if (GlobalSettings.UseKeyboardActivation)
                {
                    try
                    {
                        if ((GlobalSettings.Modifiers & Keys.LWin) != 0)
                        {
                            mod |= KeyModifiers.Windows;
                        }
                        if ((GlobalSettings.Modifiers & Keys.Shift) != 0)
                        {
                            mod |= KeyModifiers.Shift;
                        }
                        if ((GlobalSettings.Modifiers & Keys.Alt) != 0)
                        {
                            mod |= KeyModifiers.Alt;
                        }
                        if ((GlobalSettings.Modifiers & Keys.Control) != 0)
                        {
                            mod |= KeyModifiers.Control;
                        }
                        hotKeys = new Hotkeys(mod, GlobalSettings.Shortcut, this);
                    }
                    catch (ArgumentException)
                    {
                        hotKeys = null;
                        RtlAwareMessageBox.Show(SR.HotkeyCollision(HotKeyMessage), SR.KrentoShortName, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }

                    if (GlobalSettings.CircleSelector)
                    {
                        try
                        {
                            ringKeys = new Hotkeys(KeyModifiers.Windows, Keys.N, this);
                        }
                        catch
                        {
                            ringKeys = null;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                TraceDebug.Trace("PrepareKeyboardHook: ", ex);
                throw;
            }
        }