Microsoft.R.Support.Help.Packages.PackageInfo.LoadFunctionsIndexAsync C# (CSharp) Method

LoadFunctionsIndexAsync() public method

public LoadFunctionsIndexAsync ( ) : System.Threading.Tasks.Task
return System.Threading.Tasks.Task
        public async Task LoadFunctionsIndexAsync() {
            var functionNames = await GetFunctionNamesAsync();
            foreach (var functionName in functionNames) {
                _functions.Add(new FunctionInfo(functionName));
            }
        }

Usage Example

Exemplo n.º 1
0
        /// <summary>
        /// From the supplied names selects packages that are not in the index and attempts
        /// to add them to the index. This typically applies to packages that were just installed.
        /// </summary>
        private async Task <IEnumerable <IPackageInfo> > TryAddMissingPackagesAsync(IEnumerable <string> packageNames)
        {
            var list = new List <IPackageInfo>();

            // Do not attempt to add new package when index is still being built
            if (packageNames.Any() && _buildIndexLock.IsSet)
            {
                try {
                    var installedPackages = await GetInstalledPackagesAsync();

                    var packagesNotInIndex = installedPackages.Where(p => packageNames.Contains(p.Package));
                    foreach (var p in packagesNotInIndex)
                    {
                        var info = new PackageInfo(_host, p.Package, p.Description, p.Version);
                        _packages[p.Package] = info;

                        await info.LoadFunctionsIndexAsync();

                        _functionIndex.RegisterPackageFunctions(info);

                        list.Add(info);
                    }
                } catch (RHostDisconnectedException) { }
            }
            return(list);
        }
All Usage Examples Of Microsoft.R.Support.Help.Packages.PackageInfo::LoadFunctionsIndexAsync