/// <summary>
        /// Opens a cloze hint window to get cloze hint options from the user.
        /// </summary>
        /// <returns>ClozeHintWdw Object or null</returns>
        private ClozeHintWdw OpenClozeHintWdw()
        {
            // return if ClozeHintWdw is already open
            if (CurrentWdw != null && !CurrentWdw.IsClosed)
            {
                return(null);
            }

            return(Application.Current.Dispatcher.Invoke(() =>
            {
                CurrentWdw = new ClozeHintWdw();
                CurrentWdw.ShowDialog(); // TODO: Don't use the window as a return value, just launch the
                // cloze creation from the window

                // Attempt to fix bug
                //Win32Interop.ClickSimulateFocus(CurrentWdw);
                //Win32Interop.SetForegroundWindow((new WindowInteropHelper(CurrentWdw)).Handle);
                //Win32Interop.SetActiveWindow((new WindowInteropHelper(CurrentWdw)).Handle);
                //FocusManager.SetFocusedElement(CurrentWdw, CurrentWdw.ClozeHintTextbox);
                //System.Windows.Input.Keyboard.Focus(CurrentWdw.ClozeHintTextbox);

                return CurrentWdw.Confirmed
          ? CurrentWdw
          : null;
            }));
        }
        protected override void PluginInit()
        {
            LoadConfig().Wait();

            Svc.HotKeyManager
            .RegisterGlobal(
                "AdvancedClozer",
                "Create cloze hint",
                HotKeyScope.SMBrowser,
                new HotKey(Key.Z, KeyModifiers.AltShift),
                CreateClozeHint
                )
            .RegisterGlobal(
                "ResurrectParent",
                "Bring the parent of a cloze back to life",
                HotKeyScope.SMBrowser,
                new HotKey(Key.R, KeyModifiers.AltShift),
                ResurrectParent
                )
            .RegisterGlobal(
                "ClozeAsItem",
                "Create a cloze as an item.",
                HotKeyScope.SMBrowser,
                new HotKey(Key.I, KeyModifiers.AltShift),
                CreateItemCloze
                );


            Application.Current.Dispatcher.Invoke(() =>
            {
                var wdw    = new ClozeHintWdw();
                wdw.Width  = 1;
                wdw.Height = 1;
                wdw.ShowAndActivate();
                wdw.Close();
            });
        }