AdvancedLauncher.Tools.Interop.RedirectedHwndSourceHost.TranslateAcceleratorCore C# (CSharp) Method

TranslateAcceleratorCore() protected final method

protected final TranslateAcceleratorCore ( System.Windows.Interop.MSG &msg, ModifierKeys modifiers ) : bool
msg System.Windows.Interop.MSG
modifiers ModifierKeys
return bool
        protected override sealed bool TranslateAcceleratorCore(ref MSG msg, ModifierKeys modifiers)
        {
            if (_hwndSource != null) {
                HwndSourceHostRoot root = (HwndSourceHostRoot)_hwndSource.RootVisual;

                Debug.Assert(root.IsLogicalParentEnabled);
                root.IsLogicalParentEnabled = false;
                try {
                    return ((IKeyboardInputSink)_hwndSource).TranslateAccelerator(ref msg, modifiers);
                } finally {
                    root.IsLogicalParentEnabled = true;
                }
            } else {
                return base.TranslateAcceleratorCore(ref msg, modifiers);
            }
        }