Esempio n. 1
0
        /// <summary>
        /// Returns package definition list of installed packages in the TAP installation defined in the constructor, and system-wide packages.
        /// </summary>
        /// <returns></returns>
        public List <PackageDef> GetPackages()
        {
            List <PackageDef> plugins       = new List <PackageDef>();
            List <string>     package_files = new List <string>();


            // Add normal package from OpenTAP folder
            package_files.AddRange(PackageDef.GetPackageMetadataFilesInTapInstallation(TapPath));

            // Add system wide packages
            package_files.AddRange(PackageDef.GetSystemWidePackages());

            foreach (var file in package_files)
            {
                var package = installedPackageMemorizer.Invoke(file);
                if (package != null && !plugins.Any(s => s.Name == package.Name))
                {
#pragma warning disable 618
                    package.Location = file;
#pragma warning restore 618
                    package.PackageSource = new InstalledPackageDefSource
                    {
                        Installation       = this,
                        PackageDefFilePath = file
                    };
                    plugins.Add(package);
                }
            }

            return(plugins);
        }