Sorting of AddIns implemented.

This commit is contained in:
Glatzemann 2011-12-15 14:58:56 +00:00
parent 571ae26707
commit 95b2968294
4 changed files with 15 additions and 5 deletions

View File

@ -8,6 +8,7 @@ using ANX.Framework.Input;
using NLog;
using System.Collections;
using System.Resources;
using System.Xml.Linq;
#endregion // Using Statements
@ -152,9 +153,7 @@ namespace ANX.Framework.NonXNA
}
}
this.inputSystems.Sort();
this.renderSystems.Sort();
this.soundSystems.Sort();
SortAddIns();
}
}
@ -291,6 +290,15 @@ namespace ANX.Framework.NonXNA
throw new AddInLoadingException(String.Format("couldn't find a DefaultCreator of type '{0}'", type.FullName));
}
public void SortAddIns()
{
this.inputSystems.Sort();
this.renderSystems.Sort();
this.soundSystems.Sort();
this.creators = this.creators.OrderBy(x => x.Value.Priority).ToDictionary(x => x.Key, x => x.Value);
}
public OperatingSystem OperatingSystem
{
get

View File

@ -71,7 +71,7 @@ namespace ANX.RenderSystem.Windows.DX11
public int Priority
{
get { return 5; }
get { return 15; }
}
public bool IsSupported

View File

@ -22,6 +22,8 @@ namespace WindowsGame1
private void AddInSelector_Load(object sender, EventArgs e)
{
AddInSystemFactory.Instance.SortAddIns();
foreach (IRenderSystemCreator renderSystemCreator in AddInSystemFactory.Instance.GetCreators<IRenderSystemCreator>())
{
cbRenderSystem.Items.Add(renderSystemCreator.Name);

View File

@ -73,7 +73,7 @@ namespace ANX.SoundSystem.OpenAL
public int Priority
{
get { return 10; }
get { return 100; }
}
public bool IsSupported