using System.Collections.Generic; using System.Linq; using Umbraco.Web.Install.Models; namespace Umbraco.Web.Install { public sealed class InstallStepCollection { private readonly InstallHelper _installHelper; private readonly IEnumerable _orderedInstallerSteps; public InstallStepCollection(InstallHelper installHelper, IEnumerable orderedInstallerSteps) { _installHelper = installHelper; _orderedInstallerSteps = orderedInstallerSteps; } /// /// Get the installer steps /// /// /// /// The step order returned here is how they will appear on the front-end if they have views assigned /// public IEnumerable GetAllSteps() { return _orderedInstallerSteps; } /// /// Returns the steps that are used only for the current installation type /// /// public IEnumerable GetStepsForCurrentInstallType() { return GetAllSteps().Where(x => x.InstallTypeTarget.HasFlag(_installHelper.GetInstallationType())); } } }