Sort services by name in `Help` > `Features...`
This commit is contained in:
parent
ab587289a8
commit
0e3d786c70
|
@ -5,6 +5,7 @@ using System.Windows.Forms;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
|
||||||
using BizHawk.Client.Common;
|
using BizHawk.Client.Common;
|
||||||
|
using BizHawk.Common.CollectionExtensions;
|
||||||
using BizHawk.Emulation.Common;
|
using BizHawk.Emulation.Common;
|
||||||
using BizHawk.Emulation.Cores;
|
using BizHawk.Emulation.Cores;
|
||||||
|
|
||||||
|
@ -24,27 +25,15 @@ namespace BizHawk.Client.EmuHawk
|
||||||
{
|
{
|
||||||
CoreName = emu.Attributes().CoreName;
|
CoreName = emu.Attributes().CoreName;
|
||||||
Released = emu.Attributes().Released;
|
Released = emu.Attributes().Released;
|
||||||
Services = new Dictionary<string, ServiceInfo>();
|
|
||||||
var ser = emu.ServiceProvider;
|
var ser = emu.ServiceProvider;
|
||||||
foreach (Type t in ser.AvailableServices.Where(type => type != emu.GetType()))
|
Services = ser.AvailableServices.Except([ emu.GetType() ])
|
||||||
{
|
.Select(t => new ServiceInfo(t, ser.GetService(t)))
|
||||||
var si = new ServiceInfo(t, ser.GetService(t));
|
.OrderBy(si => si.TypeName)
|
||||||
Services.Add(si.TypeName, si);
|
.ToDictionary(static si => si.TypeName);
|
||||||
}
|
|
||||||
|
|
||||||
var notApplicableAttribute = ((ServiceNotApplicableAttribute)Attribute
|
var notApplicableAttribute = ((ServiceNotApplicableAttribute)Attribute
|
||||||
.GetCustomAttribute(emu.GetType(), typeof(ServiceNotApplicableAttribute)));
|
.GetCustomAttribute(emu.GetType(), typeof(ServiceNotApplicableAttribute)));
|
||||||
|
NotApplicableTypes = (notApplicableAttribute?.NotApplicableTypes ?? [ ])
|
||||||
if (notApplicableAttribute != null)
|
.Select(static x => x.ToString()).Order().ToList();
|
||||||
{
|
|
||||||
NotApplicableTypes = notApplicableAttribute.NotApplicableTypes
|
|
||||||
.Select(x => x.ToString())
|
|
||||||
.ToList();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
NotApplicableTypes = new List<string>();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue