public async Task <bool> TryHandleCommandAsync(IImmutableSet <IProjectTree> nodes, long commandId, bool focused, long commandExecuteOptions, IntPtr variantArgIn, IntPtr variantArgOut) { _appShell.AssertIsOnMainThread(); if (commandId != RPackageCommandId.icmdSendToRemote) { return(false); } var properties = _configuredProject.Services.ExportProvider.GetExportedValue <ProjectProperties>(); string projectDir = Path.GetDirectoryName(_configuredProject.UnconfiguredProject.FullPath); string fileFilterString = await properties.GetFileFilterAsync(); Matcher matcher = new Matcher(StringComparison.OrdinalIgnoreCase); matcher.AddIncludePatterns(fileFilterString.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries)); List <string> filteredFiles = new List <string>(); filteredFiles.AddRange(matcher.GetMatchedFiles(nodes.GetAllFolderPaths(_configuredProject.UnconfiguredProject))); // Add any file that user specifically selected. This can contain a file ignored by the filter. filteredFiles.AddRange(nodes.Where(n => n.IsFile()).Select(n => n.FilePath)); string projectName = properties.GetProjectName(); string remotePath = await properties.GetRemoteProjectPathAsync(); if (filteredFiles.Count > 0) { await SendToRemoteAsync(filteredFiles.Distinct(), projectDir, projectName, remotePath); } return(true); }