ACAT.Lib.Extension.DialogUtils.ShowTaskSwitcher C# (CSharp) Method

ShowTaskSwitcher() public static method

Activates the Switch Windows functional agent to enable the user to switch windows/apps. If taskname is not null, it only shows windows belonging to the task (eg notepad, word)
public static ShowTaskSwitcher ( string taskName = "" ) : void
taskName string filter by this process name
return void
        public static async void ShowTaskSwitcher(string taskName = "")
        {
            try
            {
                Context.AppTalkWindowManager.CloseTalkWindow();
                IApplicationAgent switchWindowsAgent = Context.AppAgentMgr.GetAgentByName("Switch Windows Agent");
                if (switchWindowsAgent == null)
                {
                    return;
                }

                IExtension extension = switchWindowsAgent;
                extension.GetInvoker().SetValue("FilterByProcessName", taskName);
                await Context.AppAgentMgr.ActivateAgent(switchWindowsAgent as IFunctionalAgent);
                Log.Debug("Returned from activate agent");
            }
            catch (Exception ex)
            {
                Log.Debug(ex.ToString());
            }
        }