public override void OnFocusChanged(WindowActivityMonitorInfo monitorInfo, ref bool handled)
{
Log.Debug();
if (String.Compare(monitorInfo.FocusedElement.Current.ClassName, DocClassName, true) == 0)
{
createMSWordTextInterface();
if (monitorInfo.IsNewFocusedElement)
{
showPanel(this, new PanelRequestEventArgs(PanelClasses.Alphabet, monitorInfo));
}
if (monitorInfo.IsNewWindow)
{
loadWordPredictionContext();
}
}
else if (autoSwitchScanners)
{
if (isRecentDocuments(monitorInfo.FocusedElement))
{
showPanel(this, new PanelRequestEventArgs(PanelClasses.DialogContextMenu, ScannerTitle, monitorInfo));
}
else if (String.Compare(monitorInfo.FocusedElement.Current.ClassName, "NetUIToolWindow") == 0)
{
showPanel(this, new PanelRequestEventArgs(PanelClasses.MenuContextMenu, ScannerTitle, monitorInfo));
}
else
{
handled = false;
return;
}
}
else if (!_scannerShown)
{
showPanel(this, new PanelRequestEventArgs(PanelClasses.Alphabet, monitorInfo));
_scannerShown = true;
}
handled = true;
}