ACAT.Lib.Extension.AppAgents.TalkWindow.TalkWindowAgentBase.getTalkWindowSelectedTextOrPara C# (CSharp) Method

getTalkWindowSelectedTextOrPara() protected method

Returns the text from the talk window. The text is either one that is currently selected, or the current paragraph
protected getTalkWindowSelectedTextOrPara ( ) : String
return String
        protected String getTalkWindowSelectedTextOrPara()
        {
            String retVal = String.Empty;

            try
            {
                if (Context.AppTalkWindowManager.IsTalkWindowVisible)
                {
                    using (AgentContext context = Context.AppAgentMgr.ActiveContext())
                    {
                        retVal = context.TextAgent().GetSelectedText().Trim();
                        if (String.IsNullOrEmpty(retVal))
                        {
                            context.TextAgent().GetParagraphAtCaret(out retVal);
                            retVal = retVal.Trim();
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Log.Exception(ex);
            }

            return retVal;
        }