Ejemplo n.º 1
0
 private WorkloadConstraint(
     IEngineEnvironmentSettings environmentSettings,
     ITemplateConstraintFactory factory,
     IReadOnlyList <WorkloadInfo> workloads,
     Func <IReadOnlyList <string>, string> remedySuggestionFactory)
     : base(environmentSettings, factory)
 {
     _installedWorkloads       = new HashSet <string>(workloads.Select(w => w.Id), StringComparer.InvariantCultureIgnoreCase);
     _installedWorkloadsString = workloads.Select(w => $"{w.Id} \"{w.Description}\"").ToCsvString();
     _remedySuggestionFactory  = remedySuggestionFactory;
 }
 private SdkVersionConstraint(
     IEngineEnvironmentSettings environmentSettings,
     ITemplateConstraintFactory factory,
     NuGetVersionSpecification currentSdkVersion,
     IEnumerable <NuGetVersionSpecification> installedSdkVersions,
     Func <IReadOnlyList <string>, IReadOnlyList <string>, string> remedySuggestionFactory)
     : base(environmentSettings, factory)
 {
     _currentSdkVersion       = currentSdkVersion;
     _installedSdkVersion     = installedSdkVersions.ToList();
     _remedySuggestionFactory = remedySuggestionFactory;
 }
Ejemplo n.º 3
0
 public TestConstraint(ITemplateConstraintFactory factory)
 {
     Type = factory.Type;
 }
Ejemplo n.º 4
0
 internal ConstraintBase(IEngineEnvironmentSettings environmentSettings, ITemplateConstraintFactory factory)
 {
     EnvironmentSettings = environmentSettings;
     Factory             = factory;
 }
            internal static async Task <SdkVersionConstraint> CreateAsync(IEngineEnvironmentSettings environmentSettings, ITemplateConstraintFactory factory, CancellationToken cancellationToken)
            {
                var versions =
                    await ExtractInstalledSdkVersionAsync(
                        environmentSettings.Components.OfType <ISdkInfoProvider>(),
                        cancellationToken).ConfigureAwait(false);

                return(new SdkVersionConstraint(environmentSettings, factory, versions.CurrentSdkVersion, versions.InstalledVersions, versions.RemedySuggestionFactory));
            }
Ejemplo n.º 6
0
            internal static async Task <WorkloadConstraint> CreateAsync(IEngineEnvironmentSettings environmentSettings, ITemplateConstraintFactory factory, CancellationToken cancellationToken)
            {
                var workloadsInfo =
                    await ExtractWorkloadInfoAsync(
                        environmentSettings.Components.OfType <IWorkloadsInfoProvider>(),
                        environmentSettings.Host.Logger,
                        cancellationToken).ConfigureAwait(false);

                return(new WorkloadConstraint(environmentSettings, factory, workloadsInfo.Workloads, workloadsInfo.RemedySuggestionFactory));
            }
Ejemplo n.º 7
0
 internal OSConstraint(IEngineEnvironmentSettings environmentSettings, ITemplateConstraintFactory factory)
     : base(environmentSettings, factory)
 {
 }