ACAT.Extensions.Default.AppAgents.TalkWindowAgent.TalkWindowContextMenu.getTalkWindowText C# (CSharp) Method

getTalkWindowText() static private method

Returns either the selected text or the current paragraph in the talk window
static private getTalkWindowText ( ) : String
return String
        internal static String getTalkWindowText()
        {
            var 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;
        }