private async Task getFileToAttach()
{
IApplicationAgent fileBrowserAgent = Context.AppAgentMgr.GetAgentByName("FileBrowser Agent");
if (fileBrowserAgent == null)
{
return;
}
fileBrowserAgent.GetInvoker().SetValue("AutoLaunchFile", false);
fileBrowserAgent.GetInvoker().SetValue("SelectActionOpen", true);
fileBrowserAgent.GetInvoker().SetValue("IncludeFileExtensions", new[] { "*.", "txt", "doc", "docx" });
fileBrowserAgent.GetInvoker().SetValue("ActionVerb", "Attach");
Log.Debug("Calling ActivateAgent");
await Context.AppAgentMgr.ActivateAgent(fileBrowserAgent as IFunctionalAgent);
Log.Debug("Returned from ActivateAgent");
_fileAttachment = fileBrowserAgent.GetInvoker().GetStringValue("SelectedFile");
}