public override void CheckWidgetEnabled(CheckEnabledArgs arg)
{
arg.Handled = true;
switch (arg.Widget.SubClass)
{
case "ShowWindowPosSizeMenu":
arg.Enabled = !Context.AppTalkWindowManager.IsTalkWindowVisible;
arg.Handled = true;
break;
case "ClearTalkWindowText":
arg.Enabled = !Context.AppTalkWindowManager.IsTalkWindowEmpty();
break;
case "ContextualMenu":
arg.Enabled = true;
break;
case "SpeechControl":
if (_ttsEngineSupportsSpeechControl)
{
String word;
TextControlAgent.GetWordAtCaret(out word);
object ret = Context.AppTTSManager.ActiveEngine.GetInvoker().InvokeExtensionMethod("IsValidSpeechControlSequence", word);
if (ret is bool)
{
arg.Enabled = (bool)ret;
}
}
break;
case "QuickSearch":
case "GoogleSearch":
case "WikiSearch":
arg.Enabled = !String.IsNullOrEmpty(getTalkWindowSelectedTextOrPara().Trim());
break;
default:
arg.Handled = false;
break;
}
}