Files
Umbraco-CMS/src/Umbraco.Web/Install/InstallStepCollection.cs
Shannon Deminick 1be3af1e31 Working on #U4-1358 - moving Base page classes to their correct location/assembly. Migrated all installation webforms files and associated helper files to
their correct locations/namespaces/assemblies and obsoleted all of the old ones and ensure the old webforms files don't exist where the obsoleted ones were.
Fixes a security issue with the installer ajax service (used to be p.aspx, now is InstallerRestService.aspx)
2013-02-03 05:06:11 +06:00

50 lines
1.3 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections.Specialized;
namespace Umbraco.Web.Install
{
internal class InstallerStepCollection : Dictionary<string, InstallerStep>
{
public void Add(InstallerStep step){
step.Index = this.Count;
this.Add(step.Alias, step);
}
public InstallerStep Get(string key)
{
return this.First(item => item.Key == key).Value;
}
public bool StepExists(string key)
{
return this.ContainsKey(key);
}
public InstallerStep GotoNextStep(string key)
{
var s = this[key];
foreach(var i in this.Values){
// System.Web.HttpContext.Current.Response.Write(i.Index.ToString() + i.Alias);
if (i.Index > s.Index && !i.Completed()) {
// System.Web.HttpContext.Current.Response.Write( "FOUND" + i.Index.ToString() + i.Alias);
return i;
}
}
return null;
}
public InstallerStep FirstAvailableStep()
{
return this.First(item => item.Value.Completed() == false ).Value;
}
}
}