Ejemplo n.º 1
0
        /// <inheritdoc />
        protected override InstallOptions GetInstallOptions(PackageVersionId version)
        {
            InstallOptions options = base.GetInstallOptions(version);

            options.AllowUpgradeToUnknownVersion = this.IncludeUnknown.ToBool();
            return(options);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Converts a <see cref="CatalogPackage" /> to a string previewing the specified version.
 /// </summary>
 /// <param name="package">A <see cref="CatalogPackage" /> instance.</param>
 /// <param name="version">A <see cref="PackageVersionId" /> instance. If null, the latest available version is used.</param>
 /// <returns>A <see cref="string" /> instance.</returns>
 public static string ToString(
     this CatalogPackage package,
     PackageVersionId version)
 {
     if ((version != null) || (package.AvailableVersions.Count > 0))
     {
         string versionString = (version is null)
             ? package.AvailableVersions[0].Version
             : version.Version;
         return($"{package.Name} [{package.Id}] Version {versionString}");
     }
     else
     {
         // There were no available versions!
         return($"{package.Name} [{package.Id}]");
     }
 }
Ejemplo n.º 3
0
        private UninstallOptions GetUninstallOptions(PackageVersionId version)
        {
            var options = ComObjectFactory.Value.CreateUninstallOptions();

            if (this.Log != null)
            {
                options.LogOutputPath = this.Log;
            }

            options.PackageUninstallMode = this.Mode;
            if (version != null)
            {
                options.PackageVersionId = version;
            }

            return(options);
        }